ASP.NET Web Application template missing in Visual

2020-06-07 08:00发布

问题:

has anyone else dealt with this? My ultimate goal is to create a new empty web api project. I've been following tutorials and I've encountered the following issue:

My issue is that when I try to create a ASP.NET Web Application project in Visual Studio Pro 2012 I do not see that template as an option. I go to Installed --> Templates --> Visual C# --> Web

All I see is ASP.NET Empty Web Application. So I selected that and then expected the ASP.Net project window to pop up so that I could select "Web Api". However, that dialog never opened.

Does anyone know how/where I can get the ASP.NET Web Application template?

回答1:

I came across your question as I had the same problem. When I first installed Visual Studio I didn't tick the box to install the Web Components. Here is how I solved the issue:

  1. Close all your instances of Visual Studio.
  2. Run the Visual Studio Installer (I found mine in the Downloads folder still and was named "vs_professional.exe").
  3. For VS 2013 a grey window appears similar to when first installing VS.
  4. When prompted select "Modify" from the list of options.
  5. Tick the list item which I think was named "Web Development" or something similar.
  6. Click update.
  7. Once the installer has finished running launch Visual Studio.

When selecting New Project in Visual Studio I can now see the required templates.



回答2:

Try to select Framework 4.5. The Framework 4.0 don't have :)

Jorge Rocha



回答3:

If you have ASP.NET MVC 4 Web Application as an option under Web when you select it as a new project the project window pops up and you will be able to select Web API.



回答4:

kale909's solution worked for me. I just added pics here to make it more clear: then here: