在VS 2012中创建新Controller时,MVC Controller Wizard不会出现

时间:2021-01-11 10:40:40

This is specific to one particular project. Probably missing some directives in Web.Config. Trying to figure out what those directives are. I could probably do some diff compare with a project where the wizard works, but I'm too lazy...

这是针对一个特定项目的。可能在Web.Config中遗漏了一些指令。试图弄清楚那些指令是什么。我可能会做一些差异比较向导工作的项目,但我太懒了...

1 个解决方案

#1


1  

It's a Project Guid in the .csproj file that indicates that the project is an ASP.NET MVC project and enables the wizards.

它是.csproj文件中的Project Guid,表示该项目是ASP.NET MVC项目并启用向导。

For ASP.NET MVC 4 you need the following:

对于ASP.NET MVC 4,您需要以下内容:

<ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

and to enable Intellisense in Razor views you need the following key in your web.config:

要在Razor视图中启用Intellisense,您需要在web.config中使用以下密钥:

<appSettings>
    <add key="webpages:Version" value="2.0.0.0" />
</appSettings>

If this is an ASP.NET MVC 3 project then the value is:

如果这是一个ASP.NET MVC 3项目,则值为:

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

and:

和:

<appSettings>
    <add key="webpages:Version" value="1.0.0.0" />
</appSettings>

#1


1  

It's a Project Guid in the .csproj file that indicates that the project is an ASP.NET MVC project and enables the wizards.

它是.csproj文件中的Project Guid,表示该项目是ASP.NET MVC项目并启用向导。

For ASP.NET MVC 4 you need the following:

对于ASP.NET MVC 4,您需要以下内容:

<ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

and to enable Intellisense in Razor views you need the following key in your web.config:

要在Razor视图中启用Intellisense,您需要在web.config中使用以下密钥:

<appSettings>
    <add key="webpages:Version" value="2.0.0.0" />
</appSettings>

If this is an ASP.NET MVC 3 project then the value is:

如果这是一个ASP.NET MVC 3项目,则值为:

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

and:

和:

<appSettings>
    <add key="webpages:Version" value="1.0.0.0" />
</appSettings>