Pages

Tuesday, September 25, 2012

Problems with Visual Studio 11 (2012) and ASP.NET MVC 3


On a system with Visual Studio 2010 and all versions of ASP.NET MVC, I installed Visual Studio 2012. From the start it could not open an existing solution with MVC 3 project inside.
The steps to the solution:
  • Download ASP.NET MVC Tools Update for Visual Studio 11 (link)
  • Have your VS 2012 installation disc ready
As I could not install the tools update, I removed all MVC versions but v4. I also removed all the tools update packages. That still wasn't enough to let the latest update install.
So, in packages\WPT directory of your VS 2012 installation disc, find aspnet MSI installers. The installer for ASP.NET MVC 3 framework seems the same as the one in the latest package. Therefore, I removed the tools that come with VS by right-clicking the aspnetmvc3vs11tools.msi and choosing Uninstall.

Unpack AspNetMVC3ToolsUpdateVS11Setup.exe and install the tools MSI from there. Now I see all frameworks and tools in the list of installed programs and features in Control Panel.
*And* VS 2012 finally opens the solution with ASP.NET MVC 3 project in it.

8 comments:

Nick said...

Wished this worked for me. It's still giving me the incompatible error. Yet other people can open the same project just fine.

Alen's Australia said...

In the end I had to uninstall everything related to VS and MVC and install from scratch. The MVC that comes with VS 2012 is enough. No need to install additionally.

Rafael said...

Hi Alen: What do you mean with "uninstalling everything related to VS and MVC and install from scratch".
How do I do that?, Did you mean uninstalling MVC3 and MVC4? What does "everything" mean?

Alen's Australia said...

Hey, Rafael,

Yes, you are right. I went to Programs and Features and uninstalled everything that seemed to have anything to do with Visual Studio and MVC. Frameworks, tools, IDE...
Basically, I removed whatever I could in order not to fully reinstall Windows. Fortunately, that was enough. :)

Rafael said...

Hi Alen,
You are talking about uninstalling the whole Visual Studio, then, what did you do next?, if you install VS2012 you will basicalli get the same error!, it happened to me already, of course, I reinstalled windows in order to get rid of VS. But, I need VS2012, since I'm trying to make it the standard.

Alen's Australia said...

My problems went away as all of our projects were upgraded to MVC 4.
The solution that I ended up was *not to install a standalone MVC installer* but to use the VS 2012 defaults.
Now, I believe, I don't have MVC 3 support but MVC 4 works fine.

Rafael said...

But I have installed VS2012 with all it's default options without using any external MVC installer, and I have this problem when trying to open an already built MVC3 solution, how do I migrate those solutions to MVC4, is there an easy solution?, I'm not an MVC expert, because a work with Silverlight instead, but I'm readyng a dependencu injection in net book, that has examples built with MVC3...

Alen's Australia said...

If you're only trying out examples, you should be just fine with MVC 4. If I were you, I would create an MVC 4 project and continue from there.
Maybe just check the changes in MVC 4 vs 3 to see what's changed in case you run into any issues while coding the examples.
Good luck!