开发者

How do I build MVC Contrib for .NET 4?

开发者 https://www.devze.com 2023-01-04 20:50 出处:网络
I\'开发者_如何学Cve 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

I'开发者_如何学Cve 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.


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.


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号