views:

159

answers:

2

I've downloaded the source code, converted the solution to VS10 format, fixed all compilation errors (mainly deleted references to .NET 3.5 versions of System.Web.Routing and System.Web.Abstractions and added .NET 4 versions in their places) and compiled the project.

But when I add a reference to one of the output assemblies (in this case MVCContrib.TestHelpers.dll) from it's output directory (/bin/Release/) and check the referenced assembly's properties in VS it still says that the runtime version is 2.0. Why?

Altough I'd like to be able to build the source myself, in case I want to add or change something, it would also be useful to know if there was an "official" .NET 4 build out there, that I've been unable to find.

A: 

Since .NET 4 introduces a new CLR (see here and here) you indeed need to see a runtime version of 4 specified there. Perhaps you didn't compile this as .NET 4? Try looking at your local MVCContrib's properties to make sure it compiles on top of the v4 of the CLR. (Yes, I've read you saying you changed).

Or, stating the obvious, you weren't looking at the right assemblies? those DLLs shouldn't be accepted at a non-v4 projects, so how did you see "v2.0" in a compiling project?

synhershko
In fact, someone needed to state the obvious; I wasn't looking at the correct assemblies... Or, at least I think that must have been the prolbem. I double-checked everything I needed to do (it was already done) and compiled again, and this time it worked as expected. I suspect I compiled with the debug configuration selected, but looked in the release folder...
Tomas Lycken
+1  A: 

Here are the steps you need to take to convert MVCContrib to target .NET 4:

  1. Open the MVCContrib solution in VS2010 to trigger the project upgrade wizard
  2. Change all projects to target .NET 4 (go to each project's properties and in the Application sheet change the Target Framework property)
  3. Go through all projects and remove all references to System.Web.Routing and System.Web.Abstractions. Now readd references to these assemblies using the Add Reference dialog. This will force them to be the 4.0 version.

It looks to me like you might have missed step #2.

marcind
I've checked and double checked, and all the projects are set to target .NET 4. I also checked and double-checked all the references, and they are correct. However, thanks for supplying a very specific todo-list for upgrading! This helped me know there was nothing else I needed to do.
Tomas Lycken