我升级我的项目的Razor视图引擎,但仍VS2010自动生成的WebForms
问题描述:
我已经升级到MVC3和剃刀,一切工作正常。然而,在我的返回查看(模型);
查看是红色和VS2010将会将建议我生成视图。当我这样做,它会生成一个ASPX / WebForms的视图。有没有在该项目没有其他的aspx文件,如果我运行该项目,剃刀视图引擎正常工作。有一个很明显的地方设置告诉VS2010其默认为,我找不到它。有什么建议?
I have upgraded to MVC3 and Razor, everything works fine. However, in my return View(model);
the "View" is red and VS2010 will helpfully suggest I generate a view. When I do, it generates a aspx/WebForms view. There's no other aspx files in the project, and if I run the project, the Razor view engine works fine. There's obviously a setting somewhere that tells VS2010 which to default to, I can't find it. Any suggestions?
答
这些都不是明确的答案,而是,你可以尝试操作的列表。
These are not explicit answer but rather a list of actions that you could try..
- 在项目的csproj文件,确保该
< ProjectGuidType>
设置为<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>$c$c> - 尝试改变
ProjectGuid
一些其他的Guid(过去后)。您将需要更新文件的SLN或者干脆重新创建解决方案。 - 不知道你用什么方法升级,但一看的 MVC 3升级工具从的 > codePLEX
- In the csproj file of your project make sure that the
<ProjectGuidType>
are set to<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
- Try changing the
ProjectGuid
to some other Guid (last post). You will need to update the sln file or simply recreate the solution. - Not sure what method you used to upgrade, but have a look at the MVC 3 Upgrade Tool from CodePlex