ASP.NET MVC 4 breaks ASP.NET MVC 3 projects

2020-03-02 05:07发布

After installing the ASP.NET MVC 4 Developer Preview, I can no longer open MVC 3 projects, with the following error message:

The project type is not supported by this installation.

<ProjectTypeGuids> in my MVC 3 .csproj file looks right:

<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

Is this a bug in the MVC 4 developer preview, or is something missing from my Visual Studio 2010 install? And how do I solve it? Should I rollback my MVC 4 install?

I have tried running devenv /ResetSkipPkgs and installed MVC 3 Tools Update, to no avail.

4条回答
叛逆
2楼-- · 2020-03-02 05:32

Check the reference to System.Web.Mvc.dll file in your reference. Make sure its pointing to C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll

If its pointing to the one under ASP.NET MVC 4 directory then open your project file in a notepad. Look for

<Reference Include="System.Web.Mvc">
  <Private>False</Private>
</Reference>

This should be changed to

<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35, processorArchitecture=MSIL" />
查看更多
一纸荒年 Trace。
3楼-- · 2020-03-02 05:47

"" If you want to update your projects to MVC4, and open them as such in the visual studio, then ""

The solution is to change the projectType guids from

{E53F8FEA-EAE0-44A6-8774-FFD645390401}

to

{E3E379DF-F4C6-4180-9B81-6769533ABE47}

in the csproj file, after you install the mvc4 visual studio package.

查看更多
一夜七次
4楼-- · 2020-03-02 05:49

I was searching for a different issue and stumbled across this question, It is similar to a few I answered and figured I would post them here:

ModelClientValidationRule conflict

Build Errors - 'System.Web.Mvc.ModelClientValidationRule' Conflicts

查看更多
等我变得足够好
5楼-- · 2020-03-02 05:50

ASP.NET MVC 4 Developer Preview runs side by side with previous versions of ASP.NET MVC, however there are a few known issues to be aware of. The biggest one:

Installing ASP.NET MVC 4 Developer Preview breaks ASP.NET MVC 3 RTM applications. ASP.NET MVC 3 applications that were created with the RTM release (not with the ASP.NET MVC 3 Tools Update release) require the following changes in order to work side-by-side with ASP.NET MVC 4 Developer Preview. Building the project without making these updates results in compilation errors.

You'll find the solutions here.

查看更多
登录 后发表回答