views:

31

answers:

1

After solution load, Visual Studio 2008 removes reference to System from one of project files in solution.

By diff-ing with svn's copy I see that VS removes this block from project file:

<Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\..\..\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll</HintPath>
</Reference>

If I revert to svn's copy and reload the project, everythig is ok. I am puzzled that this happens on project load, not save. This started happening after I removed Visual Studio 2010 from my machine, and it only happens on this project, other projects seem unaffected.

A: 

Weird problem, how did the reference get written like that? The <HintPath> is definitely wrong, get rid of that first. Using references from the GAC is always wrong. You'd better check if the normal reference copy of System.dll is still there. It lives in c:\windows\microsoft.net\framework\v2.0.50727\System.dll.

A virgin project created with VS2008 has the reference listed like this:

<Reference Include="System" />

You might be able to salvage the .vcproj file with Notepad. Use a .vcproj created on, say, another machine as a guide.

Hans Passant
I have no idea how or when or what, but you were right. I replaced that block with your suggestion and it works.
Vnuk