Context menu to Add Controller/View missing

前端 未结 17 1027
时光说笑
时光说笑 2020-11-28 06:04

I have integrated ASP.NET MVC 4 into existing asp.net web site. Both works fine but I don\'t see any menu/shortcuts to create controller/view within visual studio IDE. Are

相关标签:
17条回答
  • 2020-11-28 06:06

    VS2012 Context menu to Add Controller/View missing

    In VS2012 & MVC4 try unistall Web API 5.2 in PM:

    UnInstall-Package Microsoft.AspNet.WebApi 
    
    0 讨论(0)
  • 2020-11-28 06:14

    You are correct. The presence of these context menu options is project type/template specific.

    0 讨论(0)
  • 2020-11-28 06:15

    I know this is an old post, but I just ran into this switching between VS2013 and VS2012 for an MVC 5 Project. The issue I had is that the version of the MVC Template I was using wasn't installed from the Visual Studio update. VS2012 didn't come with MVC5 as it came out after it, so an update was required for VS2012 to add the template. Same with VS2010 and MVC4 I imagine.

    Anyhow, downloading the update from Microsoft resolved my issue as when another version opened and saved the project, it would again disappear when using the fix above.

    Here is the link to the VS2012 MVC5 update. Ensure that you download and install both the Tools update and the VS plugin.

    http://www.microsoft.com/en-us/download/details.aspx?id=41532

    0 讨论(0)
  • 2020-11-28 06:15

    Here's what worked for me with VS 2017.

    First check if you're able to create a new empty MVC project.

    If not - this means some components are missing. Launch Visual Studio Installer (typicall sits in C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe but you cna just hit "start" and start typing "visual studio installer")

    Lick "modify" and simply re-run it with all existing components checked.

    Just make sure "ASP.NET Web development" is checked.

    0 讨论(0)
  • 2020-11-28 06:18

    Step to change the GUID

    1. Right click on the project in solution explorer
    2. Click unload project
    3. Right click again on the project in solution explorer
    4. Edit projectfolder/projectname.csproj
    5. Chagne GUID
    6. Right click and select "Reload Project"

    In <ProjectTypeGuids> tag add any of these GUIDs in beginning

    {E3E379DF-F4C6-4180-9B81-6769533ABE47};
    
    {E53F8FEA-EAE0-44A6-8774-FFD645390401};
    
    0 讨论(0)
  • 2020-11-28 06:18

    By right clicking the project in Solution Explorer, you need to unload the project, edit the project, change the tag using the chart below, and then reload the project. Paste the appropriate GUID to the front of the list in the csproj file.

    The different GUIDs for different versions of MVC:

    ASP.NET MVC 1   {603C0E0B-DB56-11DC-BE95-000D561079B0}
    ASP.NET MVC 2   {F85E285D-A4E0-4152-9332-AB1D724D3325}
    ASP.NET MVC 3   {E53F8FEA-EAE0-44A6-8774-FFD645390401}
    ASP.NET MVC 4   {E3E379DF-F4C6-4180-9B81-6769533ABE47}
    ASP.NET MVC 5   {349C5851-65DF-11DA-9384-00065B846F21}
    
    0 讨论(0)
提交回复
热议问题