What does the webpages:Version setting do?

asp.net Mvcasp.net Mvc-3Configuration

asp.net Mvc Problem Overview


When creating a new project using the ASP.Net MVC 3 tools it adds the following application setting to the Web.config:

<appSettings>
  <add key="webpages:Version" value="1.0.0.0"/>
</appSettings>

What does it do?

asp.net Mvc Solutions


Solution 1 - asp.net Mvc

This was recently introduced in ASP.NET MVC 3 projects (after installing the ASP.NET MVC 3 Tools Update). I guess it is in preparation for handling upcoming WebPages releases (Razor) in ASP.NET MVC 4 where you will be able to choose the version of the razor view engine with your application. Currently it doesn't do much.

Solution 2 - asp.net Mvc

From the MSDN Blog,

It determines which version of Razor engine to use when editing razor webpage files.

> In VS2013 Preview, we released new Razor V3 runtime and design time Engine to support MVC5 and Razor V3 website’s runtime and design time behavior. Unlike Razor V2 runtime and design time, VS2013 did not GAC these binaries. Instead, the binaries are installed in the project bin folder when corresponding NuGet package is installed, and in “%ProgramFiles (x86)%\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions \Microsoft\Web\Razor\v3.0” to support design time.` > > If the key is missing from web.config file such as default Razor V2/V3 website, VS will use bin directory’s razor dll version to determine the design time razor engine dll to load. > > Updated 10/9/2013: In VS2013 RC and RTW, VS will open the single webpage file using the highest Razor version on the box if a single webpage file (i.e. cshtml or vbhtml files) is opened without bin directory nor web.config setting.

Solution 3 - asp.net Mvc

It is being used to distinguish between the second and the third version of Razor engine.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGeneric ErrorView Question on Stackoverflow
Solution 1 - asp.net MvcDarin DimitrovView Answer on Stackoverflow
Solution 2 - asp.net MvcAnujithView Answer on Stackoverflow
Solution 3 - asp.net MvcLukáš LánskýView Answer on Stackoverflow