Create and Run MVC 5 Project in VS 2012

27,690

Solution 1

A new tutorial has been recently added to the ASP.NET website on how to upgrade an MVC4 project to MVC5.

I migrated a VS 2012 project using this tutorial without problems, but there is no design time support for Razor 3 in VS2012 due to changes in the way VS loads the razor engine.

You can edit razor pages in VS2012, but it will be a plain HTML editor.

Solution 2

Microsoft has released updated Web Tools 2013.1 that provide the support:

Note that I had to install it manually from the second link, the tools did not install properly from Web Platform Installer. Also a colleague had to install both Update 4 and these tools to get proper support.


Original answer (not actual anymore):

I received this answer from Microsoft developer:

MVC 5/Razor 3 tooling support for VS 2012 has not shipped yet. We hope to ship this support in Mid November.

Recently ASP.NET Program Manager from Microsoft mentioned in a talk that this would be included in VS2012 Update 4. Edit: unfortunately the support is not in Update 4.

So the accepted answer is true for now but we can plan to soon have this support in VS2012 as well.

Solution 3

Microsoft has released an update for this, Web Tools 2013.1 for VS2012.

http://blogs.msdn.com/b/webdev/archive/2013/11/18/announcing-release-of-asp-net-and-web-tools-2013-1-for-visual-studio-2012.aspx

Solution 4

I'm not sure MS will fix it.

The bug report says problem closed : by design

https://connect.microsoft.com/VisualStudio/feedback/details/806348/razor-intellisense-does-not-work-in-visual-studio-2012-after-upgrading-to-mvc-5-razor-3

and it is mid November

Share:
27,690

Related videos on Youtube

Alireza Noori
Author by

Alireza Noori

Alireza Noori - (Website) Bachelor of Science in Computer Science Full Stack developer I’m professionally familiar with: Desktop: C# (Winforms, WPF, Metro, etc.), C++, Pascal, Java and VB Web: ASP.Net (Core + RazorPages, MVC, WebAPI, etc.), PHP, JavaScript, CSS, HTML, React DB: MSSQL, SQLite, MySQL, MongoDB, ... Visit my website at: https://alirezanoori.ir/

Updated on May 07, 2020

Comments

  • Alireza Noori
    Alireza Noori about 4 years

    For some reason my Visual Studio 2013 Preview cannot create MVC 5 Projects. Since the MVC project is now open source in CodePlex I was wondering if there's a simple way to develop MVC 5 projects in my Visual Studio 2012 Ultimate.

    • CodeCaster
      CodeCaster almost 11 years
      "cannot create MVC 5 Projects" - explain. What did you do, what happens, what do you expect to happen, what did you try to resolve this yourself?
    • Alireza Noori
      Alireza Noori almost 11 years
      Well that's not really the question here. I'm looking to see how to use VS2012 for this. I already have posted my feedback to MSFT about this. Hopefully they'll solve it.
    • CodeCaster
      CodeCaster almost 11 years
      Well if your feedback is as extensive as your question here, you will get a "Click New Project and select MVC 5" answer. Did you try anything, does anything not work, not appear, or give an error?
    • Alireza Noori
      Alireza Noori almost 11 years
      @CodeCaster haha. Didn't mean to make you angry. I just wanted us to stay on topic. I posted the feedback along with a video. You're welcome to watch it. It really says it all. Let me know if you want anything more. Sincerely. dropbox.com/s/6nnwe5u23pte543/MVC.mp4
    • CodeCaster
      CodeCaster almost 11 years
      I'm not angry. :-) I'm just asking clarification on your question. VS projects are templates. Perhaps you can just use VS2013's MVC templates in VS2012. But like I said, please show what you have tried and what happens.
    • Alireza Noori
      Alireza Noori almost 11 years
      Hmm, haven't tried that one. How can I use those templates? Perhaps you could post it as an answer.
    • Bilal Fazlani
      Bilal Fazlani almost 11 years
      intersting... i have vs 2012.. not planning to switch to 2013 any time soon... I would really want to know how to create mvc5 project using vs2012
  • Nathan
    Nathan over 10 years
    Please vote for the corresponding bug at Microsoft connect: connect.microsoft.com/VisualStudio/feedback/details/806348/…
  • Robert Koritnik
    Robert Koritnik over 10 years
    Not any more. As of 10/09 pages will be edited with latest Razor engine instead.
  • DodyG
    DodyG over 10 years
    I have updated to Update 4 and Razor 3 is still not supported.
  • Knaģis
    Knaģis over 10 years
    I sent an e-mail to Microsoft, they said that the support is still in works and has not been shipped. Unfortunately they did not say anything more specific :(
  • cgijbels
    cgijbels over 10 years
    MS just released ASP.NET and Web Tools 2013.1 for Visual Studio 2012 which should solve all of the above
  • Bart Calixto
    Bart Calixto over 10 years
    amazing I found your comment 1 hour after you published for the first time looking into this problem. Fixed it.
  • firepol
    firepol over 10 years
    Also do not forget to install Entity Framework 6 for Visual Studio 2012: microsoft.com/en-us/download/details.aspx?id=40762
  • Samuel
    Samuel over 10 years
    @Knaģis, your description link does seem to say that it supports razor tooling with a screenshot.