Today, I encountered a relatively rare problem, I opened a MVC2 project from SVN with VS2010, right-click on the Controller folder and found that there is no option to create a new controller, right-click on the View folder does not have the option to create a new view.
My first reaction was to determine if there was a problem with the vs2010, so I opened another MVC2 project, which was OK, so I could tell that it wasn't a development tool.
Since it is not the problem of development tools, then the problem is likely to appear in the project itself, in my past experience, I guess most likely is the project file. There's a problem with the configuration in csproj.
Sure enough, after searching the internet, I found a foreign guy Tony seems to have the same problem as me, according to his experience, brother quickly locked the problem
This is the original address of the answer to the question Http://stackoverflow.com/questions/11521644/mvc-3-i-cant-add-a-new-controller-or-view, but in English, Fortunately, my brother's English is not bad ~
The main reason is the project. csproj file There is a <ProjectTypeGuids>的项目类型节点,这个节点记录的是项目类型的标识,然而,不知什么原因,这个节点的配置被人改了(比如无意中误操作),也意味项目类型不再是Mvc2,所以也就出不来Mvc2项目特有的选项
Fortunately, there are only a few types of project type, so it is not difficult to find the original MVC2 project logo, just need to find a normal MVC2 project to see it, in order to facilitate everyone, I put the right MVC2 project < ProjectTypeGuids> node configuration to paste out, lest everyone to find another MVC2 project configuration reference
<ProjectTypeGuids>{F85E285D-A4E0-4152-9332-AB1D724D3325}; {349C5851-65DF-11DA-9384-00065B846F21}; {fae04ec0-301f-11d3-bf4b-00c04f79efbc}</projecttypeguids>
MVC Project Right-click without controller option