System.Web.WebPages.Razor 3.0.0 missing - asp.net-mvc

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.

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.

Do I have ASP.NET MVC 5?

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.

ASP.NET MVC 4 RC Missing Use HTML5 Semantic Markup

I am working with Visual Studio 2010 - SP1
I installed ASP.NET MVC 4.0 RC on my box. The option "Use HTML5 semantic markup" is missing in all the project templates (empty application, Web Api, Internet app, Intranet App) when creating a new project of ASP.NET MVC 4.0 Web Application project type.
Remember, I have not installed asp.net mvc 4 beta prior to RC installation. However, this option is present when creating an asp.net mvc 3.0 web application.
You have to install this extension :
Web Standards Update for Microsoft Visual Studio 2010 SP1
Also consider installing Web Essentials. It add a tons of useful tools related to web development.

How do you directly upgrade ASP.NET MVC1 to MVC3?

I have an ASP.NET MVC1 project and want to upgrade it directly to MVC3. I assume that there are two paths:
Upgrade directly from 1 to 3
Upgrade to 2 and then do a second upgrade to 3
Which is the path most traveled?
If you are using the ASP.NET Project upgrade tool you can only do the second path right now as stated in this blog:
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.
I'm assuming you could manually upgrade directly to MVC 3, but why go through the hassle when you can run two wizards to upgrade the project for you.

Upgrading framework on a ASP.Net MVC Solution

We have an ASP.Net MVC 1.0 solution developed using Visual Studio 2008 and .net Framework 3.5SP1.
We would now like to upgrade Visual Studio to 2010.
If we just open the solution in VS 2010 and do not change the framework version, can we just continue to develop as before?
If we open the solution in VS 2010 and change the framework version to 4.0, will we automatically start using ASP.Net MVC 2.0, or will it continue to use ASP.Net MVC 1.0?
Is there anything we need to take into consideration when upgrading to ASP.Net MVC 2.0?
Thanks
Shiraz
Yes.
I don't know if this is supported, but I wouldn't go there. It would make more sense to update to MVC 2 first, then .NET 4.
Yes, lots. Look at the release notes on CodePlex. Many things have changed, including model binding, TempData handling, and the return types of HTML helpers. These are breaking changes. There's a wizard which tries to help, but you're going to have to fix some of this manually.
It will continue using ASP.NET 1.0 unless you run the tool to upgrade to 2.0. If I am not mistaken, all the tool does is update your web.config to point all MVC references to 2.0 instead of 1.0

Resources