Problems after porting VS2013 to VS2015 in MVC


I have a project that I started in VS 2013 and was set up like this:

MyMainMvcApp (Containing core Functionality)
MyPlugin (Containing plugable customer stuff)


MyPlugin contains some * .cshtml views as an embedded resource and some controllers.

In VS2013 I was able to open "Views" and I had full Razor Intellisense and no problems compiling.

In V2015, the error list shows many errors like

Feature 'lambda expression' is not available in C# 2.  Please use language version 3 or greater.
The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)



Of course, I have all the links referenced. And projects are even compiled.

I believe VS 2015 is just missing some config files in web.config or similar, so that it might resolve this stuff when opening a view in designer.

I have an app.config in a MyPlugin project that was added from Nuget. I put the same config file as my web.config but it didn't help.

Also I copied the file MyMainMvcApp \ Views \ web.config to MyPlugin \ Views \ web.config which also didn't work.

Any idea what the problem might be or ideas how to solve it?


source to share

2 answers

I started MyPlugin as a class library in VS 2013 and it worked well. Subsequently, I was unable to get MyPlugin to work as I wanted in VS 2015 designer. I created a new MyPlugin project as an MVC project and copied all my code from the old library to the new one.

This is a workaround but which solves my VS 2015 problems.



The fact that he's trying to use C # 2 is pretty important. Make sure your project targets the latest .NET version you are comfortable with. Since you are using VS2015, go all the way to 4.6 if you want, or if you want something a little bit solid, stick to 4.5.2. Just right-click your project in Solution Explorer and select Properties. Then, on the first Application tab, change the Target Framework dropdown to something appropriate.



All Articles