The primary reference "C:\src\Foo\Src\Foo\Foo\bin\Debug\Foo.dll" could not be resolved because it has an indirect dependency on the framework assembly "System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5,Profile=Client". To resolve this problem, either remove the reference "C:\src\Foo\Src\Foo\Foo\bin\Debug\Foo.dll" or retarget your application to a framework version which contains "System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". FooDriverApp
My solution is a simple one. There are two projects, one is a C# library (Foo) and the other is a tester/driver (FooDriverApp). Foo, which should have the indirect reference to System.Web doesn't. I deleted references, did all sorts of things to try and correct the issue but to no avail. My cursory searches lead to similar scenarios but all of these people were moving from the 3.5 framework to 4.0 I won't have the luxury when I commit my changes back to the repository. My issue ended up being the upgrade process flipped the target framework in my FooDriverApp.csproj from ".NET Framework 3.5" to ".NET Framework 3.5 Client Profile" In the broken version of the .csproj file, this value of <TargetFrameworkProfile>Client</TargetFrameworkProfile> is set to Client. Changing the selector in the project configuration menu to point to the 3.5 results in <TargetFrameworkProfile>
</TargetFrameworkProfile>
References
.NET Framework Client Profile
Troubleshooting .NET Framework Targeting Errors
1 comment:
Just wanted to say thanks for this post. Last year I was using VS 2008, and had no problems, but I've upgraded to 2010, and it has been an absolute nightmare!
Post a Comment