I have installed Visual Studio 2013 and the about page includes an entry called "ASP.NET Web Frameworks and tools 2013" although there is nothing on there to specifically mention ASP.NET MVC 5 (In the add/remove programs control panel, the only version of ASP.NET listed is 2.0 but I presume that's a red herring).
When I create a new ASP.NET MVC application and look in the references, I see it's referring to System.Web.MVC version 4.0.30319 which I presume is ASP.NET MVC 4.0.
Is this the right way to check which version of ASP.NET MVC a project is actually using? If I am indeed using 4.0, how do I get access to 5.0?
edit - I was an idiot
Just realised that I had the properties panel sized so that the dll version wasn't being shown on the screen, and I was looking at the runtime version instead. As Anirudha pointed out, the DLL version for asp.net 5.0 is in fact 5.0.
If you run this in the command console, you will get the latest MVC package.
PM> Install-Package Microsoft.AspNet.Mvc
You can also look in the NuGet package manager, and look in the drop down for pre-releases.
Related
I was working on an ASP.NET MVC 4 in VS2013 and everything was fine, then I've uninstalled 2013 and installed 2015, I was able to open the project, build it and even run, everything works fine (run/debug). The problem is that all my views are covered in errors:
the name 'model\Scripts\Url...' does not exist in the current context
In addition, the .Where method of a list in the model shows an error as well as all the #Html helpers. I want to emphasize that the project still works w\o any problems so the issue is UI or package related. I tried to force uninstall\upgrade Microsoft.AspNet.MVC but the package manager console throws an error and rolls back the attempt. I can provide any necessary info if it helps, thank you in advance.
The newly released VS2015 IDE seems to no longer support MVC3/MVC4 projects, while it only supports the MVC5:
Unable to find MVC3 , MVC4, MVC5 projects (or) No information about supported MVC Framework versions
If there are strict requirements to convert any existing MVC3/4 solution to MVC5 (for VS 2015), you can proceed with the steps listed in the
How to Upgrade an ASP.NET MVC 4 and Web API Project to ASP.NET MVC 5 and Web API 2 guide.
Update 2016-05-03
It seems that after installing the VS 2015 SP2 update, it behaves much better. If you have a chance, I suggest that you upgrade your IDE and check if the issue goes away.
I would like to add reference to my ASP.NET MVC4 project, but in Add reference dialog (Assemblies->Extensions), there are only version 1.0 and 2.0 of System.Web.WebPages.Razor.dll
I have installed Visual Studio Professional 2013 and ASP.NET MVC4 from Web Platform Installer. What I am missing.
The web application does not work without this reference and complains that it cannot find System.Web.WebPages.Razor.dll 3.0
Razor 3.0 is only compatible with MVC 5. In your question, you stated that you are using MVC 4, which is only compatible with Razor 2.0.
So, the real question is, why are you trying to add Razor 3.0 to MVC 4? Either stick with Razor 2.0, or upgrade your project to MVC 5.
If you have a project dependency that was designed for MVC 5 (and Razor 3.0), you might be getting this error. The same advice goes for the dependency - either change it to use Razor 2.0 and MVC 4 (assuming you can make changes to it), or upgrade the project that requires the dependency to MVC 5.
We have a very old legacy system which was developed using MVC1 through Visual Studio. Since then , Visual Studio also evolved and so has MVC.
Now we want to make our MVC1 project compliant with MVC5. Is there any, ready made tool available for this?
Various forums suggest to gradually move the project from MVC1 to MVC2, then from MVC2 to MVC3 and so on.
But I was not able to find any way of converting from MVC1 to MVC2. Although the information regarding the same is still available, but the tool to convert MVC1 to MVC2 is not found.
Can any one please throw some light on this?
You can use the old version of ASP.NET Project upgrade tool as the limitation is
The tool does not support Visual Studio 2008 solutions, MVC 1 projects, or projects targeting .NET 3.5. If you have a MVC 1.0 project you can use the old version of this tool to convert it to MVC 2.
You can also manually upgrade to MVC 3
The white paper steps for upgrading MVC1.0 to MVC2.0 are
Fiddle with web.csproj
Replace Version=1.0.0.0 in web.config by Version=2.0.0.0
Reference System.Web.Mvc (v2.0.0.0) in the project
chnange bindingRedirect in web.config
update css and js files
According to Wikipedia - asp.NET MVC 5 was released on 17th October 2013.
However on the ASP Website I can't see where to download the package.
When I try to create a new Project in VS 2013 - I can only choose asp.NET MVC 4.
How can I install MVC 5 ?
In Visual Studio 2013, the MVC project wizard was merged with the ASP.NET Web Application Wizard. When you target .NET 4.5, select the ASP.NET project. You will be presented with a new wizard that will allow you to select a base template and then customize it further by adding support for Web API or MVC. It also allows you to customize the authentication/authorization model you wish to use in your application.
The MVC 4 wizard is still present under the VS 2012 node in the New Project dialog.
Runtime packages for MVC 5, Web API 2, and Web Pages 3 were published to nuget.org, so you can upgrade existing projects.
You can also download a separate installer for Visual Studio 2012 that will allow you to create an MVC 5 and Web API 2 project, albeit empty. Once you have the project created you will be able to add views and controllers using the new scaffolding. The download for the Visual Studio 2012 support can be found at here
Thanks,
Jacques
From the nuget site:
Microsoft ASP.NET MVC 5.0.0
To install Microsoft ASP.NET MVC, run the following command in the Package Manager Console
PM> Install-Package Microsoft.AspNet.Mvc
You can download it directly from this link:
http://www.asp.net/mvc/mvc5
You can find all versions of latest MVC from below nuget
http://www.nuget.org/packages/Microsoft.AspNet.Mvc
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.