views:

191

answers:

2

When I change the target framework of any project in Visual Studio 2010 it does not actually change the System assembly references. For example if I target v2.0 and check the properties of System and System.Data I can see that they are still both v4.0. If i change the target to v3.5, System stays at v4.0 but System.Core changes to v3.5.

Because of this I am truly not targeting anything except v4.0.

+2  A: 

There may be something strange in your install. I just created a WPF project, keeping the default settings, thus targeting .NET 4. Then, I switched to 3.5. VS asked to reload the project and then the targeted runtime of the references was v2 (correct) and their version was 3.5 (with an error that Microsoft.CSharp and System.Xaml were missing, which is understandable).

Then, I did the same for .NET 3 and 2 and got the same results: after reloading the project, the version of the referenced DLLs had changed were it made sense (System.Data is always v2.0).

When using the CLR v2, the vshost debug helper had its name changed to something like vshost-clrv2.

Timores
I've uninstalled and reinstalled VS2010 and .NET 3.5 and 4.0 but the problem still persists.
Adam Driscoll
Do you experience the same behavior, i.e. VS asking you to reload the project, etc. ?
Timores
Yeah it appears that it is attempting to change the target framework but when you inspect the properties of the references they do not change unless they are in the Reference Assemblies folder. This causes a mismatch between assemblies. Some are 2.0 and some are 4.0 which leads to build breaks due to ambiguous references.
Adam Driscoll
A: 

I've reinstalled Visual Studio several times and it hasn't solved anything. After uninstalling there is 10.0 stuff laying all over the place leading me to believe the uninstaller is also leaving what ever is causing this issue. I'm going to have to reinstall the OS to get the issue to go away.

I also wanted to link to my earlier post because this post has more information about how I originally discovered this issue, contains a link to the Microsoft Connect bug report I opened and links to several other users experiencing the same problem: http://stackoverflow.com/questions/2806332/visual-studio-2010-can-no-longer-build-net-v3-5

Adam Driscoll