I have just moved my MVC project from one machine that was running VS2012 to my new machine running VS2013. Everything works when I open/build my project on the new machine however when trying to add a controller (by right clicking on the controllers folder and clicking Add>New Controller') I get the following error:
I have tried restarting everything, cleaning the code etc. but can't find out how to fix this issue. If I manually add a new item and then select MVC Controller Class it works fine.
You did say which version of ASP.NET MVC you were using in VS 2012 but below is from the Visual Studio compatibility guidelines, which may help if you were using MVC 3.
Visual Studio 2010 SP1 supports only MVC 2 and MVC 3, Visual Studio 2012 supports only MVC 3 and MVC 4, and Visual Studio 2013 supports only MVC 4. For information about how to automatically upgrade from MVC 2 to MCV 3, see ASP.NET MVC 3 Application Upgrader. For information about how to manually upgrade from MVC 2 to MVC 3, see Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3 Tools Update. For information about how to manually upgrade from MVC3 to MVC 4, see Upgrading an ASP.NET MVC 3 Project to ASP.NET MVC 4. If your project targets the .NET Framework 3.5 SP1, you must retarget it to use the .NET Framework 4.
Related
I am trying to create an ASP.NET core empty project from template. In the wizard, I select an empty project but the drop down does not contain Core 2.0
I have installed the sdk
I tried this https://developercommunity.visualstudio.com/content/problem/119362/core-20-templates-not-listed.html without success
I have no dotnet in the Path variable. Should I? The link talks about having multiples.
I did not fix the original problem on visual studio 2017 15.2 (pro). Per David's recommendation I updated to 15.7 and 2.0 now appears.
I have installed Visual Studio 2015 update 3 and have installed the latest Web Essentials update and also have installed DotnetCore version. But when I create a new asp.net project, only asp 4 templates like in the image are available
create form image
First of all, there is no ASP.NET 5 anymore. It has officially been renamed to ASP.NET Core 1.0.
You seem to have missed that announcement, which would have made the selections in Visual Studio more obvious. When you choose File > New Project..., you get to a dialog that gives you a choice to go with ASP.NET Web Application (.NET Framework), ASP.NET Core Web Application (.NET Core) or ASP.NET Core Web Application (.NET Framework). This is the dialog before the one you have posted a screenshot of.
NOTE: In order to see all 3 of these options, you need to choose at least .NET Framework 4.5 from the dropdown.
The last two options are for the new ASP.NET Core 1.0 framework. The first of which is to run on the .NET Core library (cross-platform) and the last which is for the .NET Framework 4.6.1 library (which is not cross-platform).
Of course, if you choose ASP.NET Web Application (.NET Framework) , you get a regular MVC 5 or Web API 2 application.
I realize this question has been asked by Crudler and this one by Aaiam Litigoner regarding downgrading.
Our web hosting provider failed to tell me that MVC 5 projects are not able to be hosted with our package (even letting them know absolute specifics about the project I need hosted). Bottom line, it's a huge E-commerce website that I will be in shambles to have to redo from scratch based off MVC 4 framework.
I have tried uninstalling System.Mvc references and installing MVC 4 via Nuget Package Manager, but build errors are crazy and come by the thousands since most of the code I wrote is MVC 5 based.
Is there a simple fix to downgrade MVC versions without having to start a new project and copy every single file manually, such as a patch of some sort? There's 52 projects within one solution and that's just simply not an option.
Other Specs:
Using Visual Studio 2015 Community
.NET Framework 4.5
I am developing an app in asp.net mvc 2.0 in which I want to implement Bread Crumb pattern. I browsed a lot of sites for this purpose and find the solution of my problem in MVC 3.0 through mvcsitemap provider. They are using razor syntax and I am unable to use the razor syntax in MVC 2.0. Please help me.
For using Razor View Engine, you can covert your MVC 2 application to MVC 3.
It will not be possible to use Razor in MVC 2.
MVC 3 Project Upgrade Tool
MVC 3 Project Upgrade Tool
This standalone application upgrades ASP.NET MVC 2 applications to ASP.NET MVC 3. It works for both ASP.NET MVC 3 RC 2 and RTM. The tool only supports Visual Studio 2010 solutions and MVC 2 projects targeting .NET 4.
It will not work with VS 2008 solutions, MVC 1 projects, or projects targeting .NET 3.5. Those projects will first have to be upgraded using Visual Studio 2010 and/or retargeted for .NET 4.
Can you install ASP.NET MVC3 and MVC2 side by side?
I want to install MVC3 and try it out on a smaller project. BUT I want to retain our current large project on MVC2 for a little while.
If I install MVC3, will my existing project be automatically upgraded or do I have the option to keep it on MVC2?
MVC 3 and 2 can exist side-by-side. The project file will not / does not have to be upgraded.
For more details, see http://www.asp.net/learn/whitepapers/mvc3-release-notes
Question title says it all: Can you install ASP.NET MVC3 and MVC2 side by side?
You can perfectly fine have ASP.NET MVC 2 and 3 running side by side on the same machine. In VS2010 you have the possibility of choosing which version you want when creating new projects and on the production server you can have MVC 2 and 3 applications running side by side without any problems. Just don't forget that MVC 3 implies .NET 4.0 whereas MVC can run on both .NET 3.5 and .NET 4.0 application pools.
Yes, I have MVC2 and MVC3 installed on my development machines. When you start new projects you are prompted for both MVC versions to choose from.
Yes, but:
I had a problem with NUnit because some of the classes are defined in both versions of the System.Web.Mvc dlls. The applications run fine, but an NUnit looses its mind - it blows up with a message Cannot cast SelectedList to SelectedList.
Edit
I am running NUnit 2.5.5. Whats happening is that when the application is built it is using the version 3.0.0.0 of the dll, but when it is run under NUnit by the time it loads the app dll, the 2.0.0.0 version of the dll is already loaded. Both of them have the SelectedList class defined in them and that causes the NUnit to loose its mind