1 minute read

Recently, I tried opening an MVC 3 project that was originally created in Visual Web Developer 2010. When I loaded the solution, Visual Studio failed to open it and reported that the project could not be migrated. However, opening it as a site in WebMatrix 3 worked perfectly.

Here is how to fix this issue:

First, create a new project with the same name in a temporary directory. Copy the newly generated .csproj and .sln files into your original project’s directory. Note that Visual Studio 2013 does not support creating MVC 3 projects directly, so you should create an MVC 4 project. This will not change your project configuration; the application will still compile and run as an MVC 3 project targeting .NET 4.

I have two solution (.sln) files generated by Visual Studio 2013. Which one should I copy?

Copy the .sln and .csproj files from the folder containing the Models and Controllers directories.

At this stage, compiling will likely fail. This is because the new .csproj file does not reference the original source files, views, or assets from your project.

To fix this, open the project in Visual Studio. In Solution Explorer, select all files and folders (except References), right-click, and select Exclude from Project. Then, click Show All Files, select the excluded files and folders again, and choose Include in Project. This updates the .csproj file with all your project assets without modifying the actual files, allowing the project to build successfully.

Happy coding!

Thanks for reading my post! Smile