visual studio 2013 'add controller' missin

2020-02-06 04:53发布

I update the visual studio 2010 project to visual studio 2013. Then I want to ad a new controller. but there is no add Controller option.

enter image description here

But If I create a new project in 2013 it already have the add Controller option. So how to add the new Controller? something missing in web.config or missing reference?

8条回答
Fickle 薄情
2楼-- · 2020-02-06 05:25

nothing is to be done only Add=>scafolding=>MvC5enter image description here

查看更多
何必那么认真
3楼-- · 2020-02-06 05:26

from the img you upload the Project you create is not the ASP.NET MVC Project Maybe try create a ASP.NET MVC Project will find it

查看更多
Animai°情兽
4楼-- · 2020-02-06 05:35

In my case Unloding and Reloading the project solved the problem. To unload - right click on the project name and choose "Unload Project" from the context menu. Then again right click on the project name and select "Reload Project" from the context menu.

enter image description here

enter image description here

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

Make sure your .proj file includes all the appropriate project type Guids.

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

The first GUID allows all standard MVC operations in the context menus.

查看更多
你好瞎i
6楼-- · 2020-02-06 05:40

I was working with projects from a tutorial series. Tried addinging controller would lock up VS2013 for a few seconds but i couldnt add anything. no context menu would popup. I first needed to go into nuget package manager and update that. not sure if it's a missing GUID or some assembly but that fixed the issue.

查看更多
你好瞎i
7楼-- · 2020-02-06 05:42

Include Microsoft.ASP.NET MVC from Nuget Package in your project, you should be able to see the Add View menu when you right inside a method of controller class.

查看更多
登录 后发表回答