Create and Run MVC 5 Project in VS 2012 - asp.net-mvc

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.

Microsoft has released updated Web Tools 2013.1 that provide the support:
Description
Direct download
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.

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.

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

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

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.

Related

VS2015 ASP.NET MVC the name 'model' does not exist in the current context

I was working on an ASP.NET MVC 4 in VS2013 and everything was fine, then I've uninstalled 2013 and installed 2015, I was able to open the project, build it and even run, everything works fine (run/debug). The problem is that all my views are covered in errors:
the name 'model\Scripts\Url...' does not exist in the current context
In addition, the .Where method of a list in the model shows an error as well as all the #Html helpers. I want to emphasize that the project still works w\o any problems so the issue is UI or package related. I tried to force uninstall\upgrade Microsoft.AspNet.MVC but the package manager console throws an error and rolls back the attempt. I can provide any necessary info if it helps, thank you in advance.
The newly released VS2015 IDE seems to no longer support MVC3/MVC4 projects, while it only supports the MVC5:
Unable to find MVC3 , MVC4, MVC5 projects (or) No information about supported MVC Framework versions
If there are strict requirements to convert any existing MVC3/4 solution to MVC5 (for VS 2015), you can proceed with the steps listed in the
How to Upgrade an ASP.NET MVC 4 and Web API Project to ASP.NET MVC 5 and Web API 2 guide.
Update 2016-05-03
It seems that after installing the VS 2015 SP2 update, it behaves much better. If you have a chance, I suggest that you upgrade your IDE and check if the issue goes away.

.net mvc 5.2.3 does not work correctly in visual studio 2013

After upgrading my .net mvc project to 5.2.3, it does not have nice features like validating view/action names and linking to them.
here are my project type guids
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
which should mean web application + C# and probably is correct
I have Microsoft Visual Studio Ultimate 2013 Version 12.0.31101.00 Update 4
.net version is 4.5.51641
and tools which are probably related
ASP.NET and Web Tools 12.4.51016.0
ASP.NET Web Frameworks and Tools 2012.2 4.1.21001.0
ASP.NET Web Frameworks and Tools 2013 5.2.21010.0
do i need some additional extension or is there some secret project guid for mvc 5.2.3?
Try uninstalling the package. Then clean the solution and reinstall it again.
it turned out to be a resharper issue
https://youtrack.jetbrains.com/issue/RSRP-433112
have been using this tool for so long it seemed natural to have this kind of intellisense and started to blame visual studio.

visual studio 2015 bower intellisense Error

I downloaded visual studio 2015 and created asp.net vnext empty project.I added bower.json and grunt.js
When I define dependency, intellisense works fine for items but when I define item version intellisene not works and always says not available.
Only available since July 20th, 2015 on a Visual Studio update
more on it in Scott Guthrie blog post
I will suggest simply don't use VS 2015 just yet. It is good for some random checking and Hello World apps but i tried to convert my N-tier Enterprise application into V-Next MVC 6 using VS2015. It simple is not working for me.
VS keeps on restarting and it hangs when it goes to resolve dependencies automatically.

difference between web installer and nuget installer for asp.net mvc 4

I want to install ASP.NET MVC 4, after a little googling I came across this two links
http://www.asp.net/mvc/mvc4
http://nuget.org/packages/aspnetmvc
Whats the difference between them ? As the first one prompts me that it needs Visual Studio 2010 SP1 which is approx 600+ Mb of download.
Thanks
First will install MVC 3, ASP.NET MVC 3 Tools Update (also part of SP1) and other fixes and improvements. Second works only from Visual Studio and sometimes could give more problems for you or just fire error without any help. For example when you try to compile mvc3 project: Installing MVC3 after MVC4 installation

ASP.net MVC 3 project files not showing up in new project dialog?

I installed ASP.net MVC 3 on my dev machine yesterday using the web-based installer, did a clean reboot, etc.
The MVC 3 projects still don't appear in my New Project dialog, only the MVC 2 ones. Am I missing a step?
The answer (in this case): Make sure you have the .net 4 runtime selected at the top of the new project dialog.
If you're using Visual Studio 2008, it won't show up since it's available for VS 2010 / .NET 4 only. If however you are using VS 2010 and .NET 4, they should appear unless something wonky occurred with the install.

Resources