How to migrate VS2010 MVC3 project to VS2015? - asp.net-mvc

When I try to open an existing solution (to ultimately convert it to later MVC and .NET packages), VS2015 rejects the project:
The application which this project type is based on was not found. Please try this link for further information: http://go.microsoft.com/fwlink/?LinkID=299083&projecttype=E53F8FEA-EAE0-44A6-8774-FFD645390401
That link is worthless as it takes me to a VS2013 compatibility page.
My goal is to migrate the project from MVC3/.NET4.0 to MVC5/.NET4.5.
I can't target a later MVC or .NET in VS2010. VS2015 won't open the older project so the solution here won't work Some (official or not) upgrade Mvc3 to Mvc5 guide?? for changing the properties of the project since the project won't open.

Mvc3 is not supported after VS2010.Iuse VS2010SP1.
You may make it work but it will bite you in the end.
You have to choose the VS version and the corresponding Mvc version

I went into the csproj file manually and switched the ProjectTypeGuid to that of an MVC4 project: E3E379DF-F4C6-4180-9B81-6769533ABE47. Then VS2015 was able to open the project and it upgraded it to MVC5 guid correctly.

Related

Upgrade MVC1 project to MVC5

Is there a way to convert a ASP.Net MVC 1 project build in VS2008 to ASP.Net MVC 5 and VS2015?
I tried to just open it in VS 2015 but that gave the error "This project is incompatible with the current version of Visual Studio".
There are ways to reference newer versions and update, eg:
http://www.asp.net/mvc/overview/releases/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2
.. however updating from MVC1 (especially if you cannot open the project) you probably don't want to manually install ASP.NET MVC installs etc (if that what I remember)
I would suggest creating a new MVC5 application, referencing MVC via Nuget etc and pulling in code as required. This will give you a chance to re-structure things and learn newer ways otherwise you my be fighting with MVC configuration and references.

How to upgrade mvc2 to mvc5?

I've got an old project from a friend that he wants me to do redo. How ever that project is written in ASP.net mvc2. So When I try to open it in visual studio 2013 I can errors. Saying the file is incompatible. How would I go ahead and fix this?
I would highly recommend you to create a new empty MVC 5 project, and move all your files there from old MVC 2 project. If you just try to update DLLs its very hard be sure if you updated all DLLs, proj file, nugets, or at least little bit more work by copying files is well worth it. Problem is that VS2013 is not compatible with old version of MVC framework.
But, if you really want to open MVC 2 solution in VS2013, you can try following some steps described here: How do I open an old MVC project in Visual Studio 2012 or Visual Studio 2013? (contains a project Guid that needs to be changed inside .proj file)

Adding Sitecore 7.5 to existing solution

I am trying to add the Sitecore as a separate project to an existing .Net MVC project which is built in .net framework 4.5.1.I followed the below steps to do so.
Copied Images,Assets,Scripts,Fonts folders from the existing Sample.Web project in to the sitecore project (now the sitecore project is the startup project instead of Sample.Web)
Added reference of Sample.Web to the sitecore project
Copied Views Folder as well because Sample.Web is using MVC
Merged Packages.Config file from Sample.Web Project to the packages .config that we get from Sitecore.
Merged the Web.Config file to the one present in sitecore project
I upgraded the sitecore project to target framework 4.5.1 as the existing projects were using Framework 4.5.1 using the extension https://visualstudiogallery.msdn.microsoft.com/47bded90-80d8-42af-bc35-4736fdd8cd13
Now in the above steps please suggest me on the below:
Will there be any issue in upgrading Sitecore Project to 4.5.1?
Solution is building successfully however I get the below run time error
My guess is your solution uses a more recent version of System.Web.Http than Sitecore does. Some Sitecore code is trying to load the older version of the DLL which you have most likely overwritten with the newer version, thus the exception.
If my guess is correct, I would suggest you rework your solution to use the same assemblies as Sitecore.

After installing MVC3, I can't create or open projects for MVC2 on visual studio 2010

Opening MVC2 Projects just makes "project not supported" error on visual studio, and i can't find the template for creating new projects for mvc2.
I undertand that the mvc2 new project template could be not desired after installing mvc3, but the support for editing and maitaining mvc2 projects should still be there.
in the release notes it states:
ASP.NET MVC 3 can be installed side by
side with ASP.NET MVC 2 on the same
computer, which gives you flexibility
in choosing when to upgrade an ASP.NET
MVC 2 application to ASP.NET MVC 3
I know I have mvc1, mvc2 and mvc3 dlls "side by side" on my GAC, but i'm still hoping this visual studio error is a error in my setup.
If not, ¿Is possible to upgrade the project file and keep all contents the same, pointing to the mvc2 dll?
To answer my own question after a few attempts:
Yes, it is possible to upgrade the project without altering MVC2. Just apply step 8 of the manual migration procedure on the release notes for MVC3:
8- Locate the ProjectTypeGuids element and replace
{F85E285D-A4E0-4152-9332-AB1D724D3325}
with
{E53F8FEA-EAE0-44A6-8774-FFD645390401}.
and reload the project.
This should be all.
The downside is that if other people are working on this project, they will now need to install MVC3 too, in order to get Visual Studio to recognize this new project GUID.

ASP.net MVC RTM - "project type is not supported"

After installing ASP.net MVC, when I attempt to load a existing or a new MVC application (straight from New Project - A project for creating an application using the ASP.NET MVC framework (1.0) (.NET Framework 3.5)) I get the following error:
Microsoft Visual Studio
The project file 'path' cannot be opened.
The project type is not supported by this installation.
OK Help
Tried reinstalling which didn't help. Tried devenv /setup which also didn't help.
Any ideas?
The reason was because I didn't have the Visual Web Development part of VS installed. I only had the C# language. As such, MVC didn't check and installed successfully but couldn't use the underlying part.
After installing the Web Dev bit everything worked as expected...
You could also try to run the following command:
devenv /ResetSkipPkgs
This will try to load any Visual Studio packages that failed previously at some point, such as the WPF project flavor package, which would cause the error message you're seeing.
Not sure if this is the same issue but going through the uninstall and re-install of beta and RC versions and finally the RTW I ended up with two ASP.NET MVC Web Application icons in my "File/New/Project" dialog.
If I click the first link, my project does not load correctly. But if I click the second one everythign works great.
I haven't dug into the templates folder to see if there is a remnant from a previous version or what.
Brian
Did you install SP1 for .Net and VS2008?
The way I corrected this issue of not being able to open a ASP.NET MVC 1.0 for myself goes like this when I was using VS 2008
Install SP1 for VS 2008
Install MVC 2.0 framework
I realized I had an MVC 1.0 project and I used this tool to change the project to MVC 2.0.
The tool works great, props to Eilon Lipton never met the guy but I'm down with anyone that will make my life easier.
http://weblogs.asp.net/leftslipper/archive/2009/10/19/migrating-asp-net-mvc-1-0-applications-to-asp-net-mvc-2.aspx

Resources