[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 516
  • Last Modified:

Visual Basic .net 2005 project references not being stored by source safe 7.0....vb.net


I have been bashing my head against this issue for a while now. I really, really could use any insight you experts might have on this.

I have a visual studio .net 2005 solution that contains 53 projects. I added this solution to Visual Source Safe 7.0 by right clicking the solution and selecting "Add To Source Control". My issue is that whenever I change the references to a project via the My Project icon-->References tab, the values do not get saved in source control. This namely pertains to the Copy Local properties of the project's references.

I upgraded from VSS 6.0d just to try and fix this one issue.

Time is very short on this. Does any body have any ideas regarding what might be happening here? Really event theories would help.

Thanks in advance.
0
jbaisden
Asked:
jbaisden
  • 23
  • 18
1 Solution
 
jbaisdenAuthor Commented:
A question whose answer might help me with this problem is what file is changed when you change a project reference's Copy Local attribute?
0
 
Bob LearnedCommented:
When you change project references, does the project file get checked out?

Bob
0
 
jbaisdenAuthor Commented:
Yes it does. I've actually discovered this is an issue that occurrs within visual studio. If I change the Copy Local values for a project that has references to other projects in the same solution, save, close the solution, and open it back up, the Copy Local valeus are restored to the same state they were in when the reference was first created. This is usually a true value.

Can anyone shed some light on this?
0
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

 
Bob LearnedCommented:
That sounds like a very nasty bug, but we can confirm this.  The project file is an XML file, and after making the changes you can compare the two documents and verify what has changed.

Bob
0
 
jbaisdenAuthor Commented:

You're not going to believe me, but when I change the Copy Local attribute and compare the before and after files there is no change. i had tried this a while ago and was quite shocked.
0
 
Bob LearnedCommented:
What type of project is this?  WinForms, Console, Web Site?

Bob
0
 
jbaisdenAuthor Commented:

The solution is a blank solution with a ASP .Net Web Application project and 52 class library projects.
0
 
Bob LearnedCommented:
Are there any .refresh files in the \bin folder?

Bob
0
 
jbaisdenAuthor Commented:
No, not that I can see.
0
 
Bob LearnedCommented:
Did you create this project from scratch in 2005, or was it migrated from 2003?

Bob
0
 
Bob LearnedCommented:
Do you have project references to the DLLs or are they file references?

Bob
0
 
jbaisdenAuthor Commented:

The solution and ASP .Net Web Application project were created from scratch. The remaining 52 projects were converted from 2003 code.
0
 
jbaisdenAuthor Commented:

All references are created as project references for the most part. Some projects do reference a third party dll, but it is not possible to include that dll's source in this solution as it would make the solution very, very large.
0
 
jbaisdenAuthor Commented:

Also note that when I say I have a project that is an ASP .NET Web Application, I'm refering to the project type that can be found via this link:

http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx
0
 
Bob LearnedCommented:
So, you are using the Web Application model, instead of the Web Site model.  Can you show me how you are changing references to Copy Local, because I haven't found that option in 2005 yet?

Bob
0
 
jbaisdenAuthor Commented:

Well there are several ways.

1) Double-Click on the My Project icon beneath the project you wish to change references.
2) Click on the references tab
3) Click the Copy Local column to sort them by value
4) Click on the ones whose Copy Local value you wish to change. If you click multiple items, you need to make sure that you want all of the copy local values for the one's selected to be the same.
5) With the items selected, you will notice that the Copy Local attribute is the only attribute you are allowed to change. Use the drop down to change the selected item's Copy Local attribute to either true or false.


or the easier way.
1) Click a project
2) Click show all files
3) Click references
4) perform steps #4 & #5 from above.
0
 
Bob LearnedCommented:
I thought you were talking about changing the references from the Web Application.  It now sounds like you are talking about changing references from the class library--misunderstanding on my part.

Bob
0
 
Bob LearnedCommented:
I changed a reference from a class library, and looked at the .vbproj file, and I saw this:

  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml">
      <Private>True</Private>
    </Reference>

The <Private> entry appears to be the 'Copy Local' setting for a reference.  Are you saying that when you change the 'Copy Local', that this setting doesn't change?

Here is the complete .vbproj file, so that you can compare:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{7325CC53-35E5-4D40-BE1B-97FCAB80D561}</ProjectGuid>
    <OutputType>Library</OutputType>
    <RootNamespace>ClassLibrary1</RootNamespace>
    <AssemblyName>ClassLibrary1</AssemblyName>
    <MyType>Windows</MyType>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <DocumentationFile>ClassLibrary1.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DocumentationFile>ClassLibrary1.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml">
      <Private>True</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Class1.vb" />
    <Compile Include="My Project\AssemblyInfo.vb" />
    <Compile Include="My Project\Application.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Application.myapp</DependentUpon>
    </Compile>
    <Compile Include="My Project\Resources.Designer.vb">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="My Project\Settings.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="My Project\Resources.resx">
      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <SubType>Designer</SubType>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <None Include="My Project\Application.myapp">
      <Generator>MyApplicationCodeGenerator</Generator>
      <LastGenOutput>Application.Designer.vb</LastGenOutput>
    </None>
    <None Include="My Project\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <CustomToolNamespace>My</CustomToolNamespace>
      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
    </None>
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

Bob
0
 
jbaisdenAuthor Commented:
Err...my bad, but I think the Web application references can be changed in the same way.
0
 
jbaisdenAuthor Commented:
I'll look over the code to double check.
0
 
Bob LearnedCommented:
I don't think that you can change the 'Copy Local' for web application references.  They are gathered differently--the references are stored in the web.config file:

<compilation debug="false">
     <assemblies>
          <add assembly="Oracle.DataAccess, Version=10.2.0.200, Culture=neutral, PublicKeyToken=89B483F429C47342"/>
          <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
     </assemblies>
</compilation>

Bob
0
 
jbaisdenAuthor Commented:
Hmm....this is odd. The project references portion of the .vbproj file don't seem to have the  <Private>True</Private> property. This is what it looks like in my vbproj file (it's an excerpt):

    <ProjectReference Include="..\Common\OSDE.Wave.Common.vbproj">
      <Project>{D0DD8AF7-092C-4F01-A96F-8F3D48DB1D40}</Project>
      <Name>OSDE.Wave.Common</Name>
    </ProjectReference>
    <ProjectReference Include="..\Controllers\OSDE.Wave.Controllers.vbproj">
      <Project>{D19DE512-AD32-4B64-B4E9-2CCAB752FA1A}</Project>
      <Name>OSDE.Wave.Controllers</Name>
    </ProjectReference>
    <ProjectReference Include="..\Controls\OSDE.Wave.Controls.vbproj">
      <Project>{8BE8CF85-FD16-4239-98C0-6B53A85D6B94}</Project>
      <Name>OSDE.Wave.Controls</Name>
    </ProjectReference>
    <ProjectReference Include="..\Objects\OSDE.Wave.Objects.vbproj">
      <Project>{C2A37FF6-AFF2-4BB1-9F26-580491AFA553}</Project>
      <Name>OSDE.Wave.Objects</Name>
    </ProjectReference>

The above portion is inside of a   <ItemGroup>  </ItemGroup> set of tags. There's a lot more there, but I think this portion is the big distinction. Do project references even really have a property for Copy Local?

Tell me what you think or if you need more information.
0
 
jbaisdenAuthor Commented:
Also, the references above are for Class Libraries...if that means anything to you.
0
 
Bob LearnedCommented:
I think that project references don't get resolved the same way as physical file references, and maybe that starts to explain why the setting is lost, since it doesn't write the setting to file (as you found).

Bob
0
 
jbaisdenAuthor Commented:

Indeed, but if the setting isn't preserved then why let me change it at all? Why not just disable the copy local property in the properties window like every other property is disabled? Sounds like either a lack of understanding on my part of a Microsoft blooper if this is the case.
0
 
jbaisdenAuthor Commented:
Any thoughts?
0
 
Bob LearnedCommented:
Do you need the project references, or would it simplify the interface to reference the DLL file instead?  Then you don't have to load/compile the entire code base at one time.

Bob
0
 
jbaisdenAuthor Commented:


Honestly, I don't know the answer to that. Microsoft seems to be real big about enforcing programmers to use project references, even when it's completely unrealistic to do so; however, in this case, I think the references need to be project references. All projects can change at any point in time, including the ones that are being referenced...save for the base project that references the dll's to our web portal (DotNetNuke).

Do you happen to know whether or not the Copy Local attribute applies to project references (I.E. Referencing class library projects from other class library projects)?
0
 
Bob LearnedCommented:
I tried a test, and this is what got stored in the .vbproj file:

  <ItemGroup>
    <ProjectReference Include="..\WindowsApplication3\WindowsApplication3.vbproj">
      <Project>{23204258-591C-44AA-99C4-ACE787AAAEF3}</Project>
      <Name>WindowsApplication3</Name>
      <Private>False</Private>
    </ProjectReference>
  </ItemGroup>

Note the <Private> entry.  I changed it to 'Copy Local' = false, and I got that entry in the project.

Bob
0
 
jbaisdenAuthor Commented:

This is just beyond wierd. Okay so I open my solution, find a project, and, once again, set all project references' Copy Local values to false. I save and close the solution. I check the .vbproj file. All references have the    <Private>False</Private>. I think, okay...this is good. I then open the solution again. The VS 2005 IDE shows those same references as Copy Local = true. I do a double take. I close the .vbproj file in notepad and reopen. All private values are still the same: false.

I really don't know what to make of this. This might just be a bug in the pre-maturely released hot fix I'm running for performance and several other things. I'm going to try remove the hot fix and see if that helps any of my issues.

Thank you for all of your help. I think we're getting somewhere with this.

Jason
0
 
Bob LearnedCommented:
Yes, I don't have any hot fixes applied to my system.

Bob
0
 
jbaisdenAuthor Commented:

I removed the hotfix and this issue is still happening. I've tried removing a project and adding it back to see if something might have happened when I intially added the existing project, but that did not resolve this scenerio either. I'm one big question mark at this point. I'll keep digging.
0
 
jbaisdenAuthor Commented:
I believe this is definately a bug. I took the following steps and reproduced it from scratch. To reproduce it you need to have the ASP .NET Web Application Project installed. It can be found here:
http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx 

 Here are those steps.

1)       Open VS 2005 and create a new blank solution. It doesn’t matter what you name so long as you remember the name and where you put it. It’s location doesn’t seem to matter either.

2)       Add a new ASP .Net Web Application project to the solution. Once more the name does not matter.

3)       Open IIS and create a virtual directory that points to the directory of the web application created in step 2. Note the alias you give this, but, once again, what you call it does not matter.

4)       Right click on the Web Application in the solution and go to the Web tab.

5)       Check the option button that says: Use IIS Web Server. Put in the alias name for the virtual directory you created in step #3.

6)       In VS 2005 Add 2 more projects of type Class Library to the solution.

7)       Create a project reference to each of the two libraries.

8)       Change the Copy Local value of the references to false.  Save all.

9)       Right click the solution and rebuild all.

10)   Now navigate to the bin directory of the ASP .NET Web Application. Note that you only see the ASP .NET files. That is the .dll, .pdb, and .xml files.

11)   Open notepad and navigate to the .vbproj file for the asp .net web application. Scroll to the bottom. You can do a search on the    </ProjectReference> tag to find the appropriate spot. On my setup, this section looks like:

 

  <ItemGroup>

    <ProjectReference Include="..\ClassLibrary1\ClassLibrary1.vbproj">

      <Project>{A1EA382E-F89B-4228-A615-A30F42E0EEF2}</Project>

      <Name>ClassLibrary1</Name>

      <Private>False</Private>

    </ProjectReference>

    <ProjectReference Include="..\ClassLibrary2\ClassLibrary2.vbproj">

      <Project>{D2DDDFCC-63FD-4EBC-AF1D-D3004304863B}</Project>

      <Name>ClassLibrary2</Name>

      <Private>False</Private>

    </ProjectReference>

  </ItemGroup>

 

Note the <Private>False</Private>. This refers to the copy local value.

 

12)   Now close notepad and close the solution.

13)   Open the solution again, go to the ASP .NET Web application project properties à references. You will see that the two projects have their references set to true.

14)   Open the .vbproj file in notepad again. You will see that the <Private>False</Private> tag for the two references. My conclusion is the IDE is flat out lying to you. We can prove this.

15)   Do a rebuild all on the solution. Check the web projects bin folder. You will note that only the ASP .NET Web project’s files are there.

16)   Go back to the references for the asp .net project. Set the two references to false. Save. Now set them back to true. Save.

17)   Check the ASP .NET Web app’s bin folder again. Now all of the files for the build are present, including those for the project reference.
0
 
jbaisdenAuthor Commented:


After step 16 Do a rebuild all on the solution.
0
 
Bob LearnedCommented:
That is a very detailed step-by-step process, that I will have to test later.  The obvious question that I think I overlooked is, "Do you have a requirement to use the Web Application model, instead of the Web Site model?"

Bob
"Mr. Obvious"
0
 
jbaisdenAuthor Commented:


Lol Yes, at this point in time we do. We have 53 projects of a solution developed via that model. Furthermore, I don't understand the new Web Site model exactly. Combine the time it'd take to learn the curve and do recoding if need be and I just don't think it's feasible.
0
 
Bob LearnedCommented:
We are in the process of evaluating going from 1.1 to 2.0 right now.

I am learning the web site model, and in my opinion it is a little easier than the web application model, since all you need is a set of folders and files (no .vbproj files).  Another difference is that classes and web services code-behinds go into the App_Code folder, but you can define a separate folder sub-structure for each of the projects.

Bob
0
 
jbaisdenAuthor Commented:


How does the Web Site Model handle the seperation of the UI, business logic, and database logic? Currently we're using a setup, whose official name I don't know, that has a project for our business objects (Objects), a project for some of our business logic (Controller), and 2 projects under the same namespace (DataProvider) for the database.
0
 
Bob LearnedCommented:
It handles it the same way that the web application model does--with XHTML files for UI, code-behind and classes for code.

Bob
0
 
jbaisdenAuthor Commented:


Oh. I was actually referring to the structure of the projects in the solution. Do you have any good links for learning the Web Site Model?
0
 
Bob LearnedCommented:
Here are my resources that I use:

A comparison between ASP.NET 1.x and ASP.NET 2.0
http://www.codeproject.com/aspnet/ComparisonASP1xASP20.asp?df=100&forumid=281179&exp=0&select=1418014

Difference between web site and web application in Visual Studio 2005
http://www.dotnetspider.com/kb/Article1938.aspx

Where does the VS.NET 2005 web site model store references?
http://discuss.joelonsoftware.com/default.asp?dotnet.12.327040.1

Web Application Project vs Web Site Project in VS 2005
http://dotnetdeveloper.wordpress.com/2006/03/04/web-application-project-vs-web-site-project-in-vs-2005/

There are mixed emotions about which model is better.  For us, the Web Site model worked out OK, because there is only one web site, and deployment is simpler, since I don't have to concern myself with copying DLL files to the \bin folder if I don't want to.

Bob
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 23
  • 18
Tackle projects and never again get stuck behind a technical roadblock.
Join Now