Alireza Noori
Alireza Noori

Reputation: 15275

Create and Run MVC 5 Project in VS 2012

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.

Upvotes: 28

Views: 27834

Answers (5)

Eric Bishard
Eric Bishard

Reputation: 5341

I have a tutorial that will not only get your empty MVC 5 project working with Bundling, a controller, jQuery, jQuery UI, Modernizr and more, but it will walk you through installing Zurb's Foundation 5, a responsive Framework which I have working with Sass in MVC 5. It's all here:

http://tinyurl.com/VS12-MVC5-F5

The problem many have ran into is that Visual Studio 2012 only allows you to start from a blank MVC 5 project, so I will help you get the NuGet installed which is pretty similar to the instructions in the NuGet package with a few minor changes; however, it does not take into consideration that you will be installing from Visual Studio 2012 using a Blank MVC 5 project. If you would like to use Foundation 5 with MVC 4 Web Application template just omit the Bootstrap uninstall and the NuGet package should work fine, but if you need to use MVC 5 and you don’t have Visual Studio 2013, you will need to build the Home Controller, Bundling class, modify the Global.asax.cs as well as other quirky little things. So lets get started.

I spent a good part of a few hours getting it all working.

Upvotes: 0

Knaģis
Knaģis

Reputation: 21495

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.

Upvotes: 37

Aaron Stainback
Aaron Stainback

Reputation: 3667

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

Upvotes: 5

user965445
user965445

Reputation: 125

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

Upvotes: 2

Natan
Natan

Reputation: 4968

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.

Upvotes: 28

Related Questions