ASP.NET MVC 4 Visual Studio 2010 project templates not present

I have downloaded and installed all of the prerequisites for using MVC 4 with VS2010. The VS2010 SP1 update, ASP.NET MVC 4 for VS2010, SSDT for VS2010, and LocalDB. When I go to create a new website in VS2010, there should be an "ASP.NET MVC 4 Web Application" template, but there is not. How can I get the templates so I can start a new MVC 4 website in Visual Studio 2010?


Have you tried reinstalling the templates. Follow these directions.

http://msdn.microsoft.com/en-us/library/vstudio/ms247116(v=vs.100).aspx

short answer, open up visual studio command prompt and type:

devenv /installvstemplates

That should restore all your templates.


Check if Project Templates are installed:

  • Manually search if you find the project template (it would be *.zip) inside %ProgramFiles%Microsoft Visual Studio 10.0Common7IDEProjectTemplatesCSharpWeb1033
  • If YES, please run devenv.exe /installvstemplates
  • If NO, then its guaranteed that the ProjectTemplates are not installed. You would have to reinstall to get the ProjectTemplates on your disk.
  • For the records:

    All the installed project templates are available here: (this is the default path)

    %ProgramFiles%Microsoft Visual Studio 10.0Common7IDEProjectTemplates

    This is where the File->New ->Project Dialog loads ProjectTemplates from, and is displayed in the Same Folder heirarchy convention . You could add another path by updating

    Tools -> Options -> Projects and Solutions -> General -> User Project Template Location

    On studio(devenv.exe) launch/loading it would try to create a ProjectTemplateCache on localappdata or %ProgramFiles% based on whether you are local user or admin. The cache inside Programfiles are available here

    %ProgramFiles%Microsoft Visual Studio 10.0Common7IDEProjectTemplatesCache

    This ProjectTemplateCache directory is Created (if doesnt exists) or Updated(if already exists) by running *devenv.exe /installvstemplates on cmd. This command is run during installation of Visual Studio. Ideally all other installers who ship project templates should run this command. But, sometimes this might fail due to access rights. So its is safe to run it again manually.


    See this question

    If you didn't install the Visual Web Developer component, the ASP.NET project templates won't be fully installed. Naturally, because the installer then thinks it doesn't need to put them there as ASP.NET is a web development framework.

    链接地址: http://www.djcxy.com/p/81618.html

    上一篇: 使用SVN和TeamCity的Web应用程序部署工作流程

    下一篇: ASP.NET MVC 4 Visual Studio 2010项目模板不存在