We have moved to GitHub Issues
You are viewing the read-only archive of Umbraco's issue tracker. To create new issues, please head over to GitHub Issues.
Make sure to read the blog posts announcing the move for more information.
Created by Pintér Ákos 10 Nov 2013, 16:42:56 Updated by Mikael Syska 21 Nov 2013, 22:26:49
Is duplicated by: U4-3461
*I created an MVC 4 Empty web project *I deleted: App_Data contents, web.config of Views folder and global.asax *I get the Umbraco Belle RC via nuget (Install-Package UmbracoCms -Pre) and I chose replacing my original web config (Y) *At the Database setup step I chose a local SQL Server Database *I installed Text starter kit *I successfully logged in to the backend *The error is that I can't load the main page of the site, because the web.config file of the Views folder is invalid
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized configuration section system.web.webPages.razor.
Source Error:
Line 1:
Line 2:
I have tested the Nuget installing without doing the deliting of 'App_Data contents, web.config of Views folder and global.asax'.
Had no problems.
OK, I see.
I followed the instructions of this video [http://umbraco.tv/videos/developer/fundamentals/surface-controllers/setting-up-the-vs-solution/] , but in this case is the video or the nuget package the wrong?
In the nuget package the Views/web.config doesn't declare system.web.webPages.razor .
Hi Pintér
Not sure where the error is.
The web.config in my view folder starts like this:
<system.web.webPages.razor>
Hi,
Can you please attach 3 files to this issue: ~/web.config ~/views/web.config and ~/macroscripts/web.config so we can have a look?
The ~/views/web.config from Nuget differs from the nightly build .zip file. If i use that file the error is away.
Hi, so you are saying the one in the nightly build is correct yeah ?
Hi Shannon; yes the one from the nightly is correct
The web.config in the views folder looks like this when installing from NuGet. Umbraco 7.0-RC
<!--
Enabling request validation in view pages would cause validation to occur
after the input has already been processed by the controller. By default
MVC performs request validation before a controller processes the input.
To change this behavior apply the ValidateInputAttribute to a
controller or action.
-->
<pages validateRequest="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<controls>
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>
<system.webServer>
<handlers>
<remove name="BlockViewHandler" />
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
This is the missing part for some reason:
This is the file from my Nuget install 2 days ago, the section is not missing.
I install from nuget with:
Install-Package UmbracoCms -pre
<system.web.webPages.razor>
<system.web>
<!--
Enabling request validation in view pages would cause validation to occur
after the input has already been processed by the controller. By default
MVC performs request validation before a controller processes the input.
To change this behavior apply the ValidateInputAttribute to a
controller or action.
-->
<!--
Enabling request validation in view pages would cause validation to occur
after the input has already been processed by the controller. By default
MVC performs request validation before a controller processes the input.
To change this behavior apply the ValidateInputAttribute to a
controller or action.
--><pages validateRequest="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<controls>
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>
<system.webServer>
<handlers>
<remove name="BlockViewHandler" />
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
I'm using Visual Studio 2013 and newest NuGet ... maybe that is why mine is failing.
My test was in Visual Studie 2012 Pofessional with i think the newest nuget plugin.
Very strange.
Just tested in VS 2012 ... same problem.
It's like it for some reason is being deleted cause there is some empty space where it should be.
If I look in the downloaded content for the package. This file "Web.config.transform" in the "\packages\UmbracoCms.7.0.0-RC\Content\Views" folder is there containing this:
<system.web>
<!--
Enabling request validation in view pages would cause validation to occur
after the input has already been processed by the controller. By default
MVC performs request validation before a controller processes the input.
To change this behavior apply the ValidateInputAttribute to a
controller or action.
-->
<pages
validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<controls>
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
So i'm actually wondering where that other part comes from.
What does your NuGet package "\packages\UmbracoCms.7.0.0-RC\Content\Views\Web.config.transform" file contain?
This i getting strange now.
My file contains the same as yours, it looks like, i'll do a bit more testing now to see if i can figure out what is happening.
<system.web>
<!--
Enabling request validation in view pages would cause validation to occur
after the input has already been processed by the controller. By default
MVC performs request validation before a controller processes the input.
To change this behavior apply the ValidateInputAttribute to a
controller or action.
-->
<pages
validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<controls>
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
Do note, that it only fails when accessing the site ... the Umbraco backend is working.
I have tested again, this time in Visual Studio 2013 Professional, and checked that the Nuget plugin is the newest version.
In Visual Studio 2013 i get the same error as you have.
So i tested again in Visual Studio 2012, and it did work. The problem is that in the empty MVC4 template in VS2013, there is no View's folder and no default web.config in that folder. But there is in VS2012, and the nuget install only changes a few things in the existing web.config in the views folder. Thats why it is working. (i think)
So the section you are mentioning is missing in the nuget's web.config file for the views folder.
Makes sense ... I used Empty WebProject i both cases.
I'm not sure if it helps but if no config file exists there we generate one with our view engines when they render
I will try that.
But the problem now is that for some reason NuGet genetates an invalid web.config in the Views folder when installing. Missing the configSections part of the web.config.
So ... I would guess that NuGet should not create or transform any files in the Views folder if the file does not exist. This would solve the problem I guess.
Fixed in rev 313b831559ec21aa7bb66479eb1621f93e2fa40a
Not sure if this is the right commit: https://github.com/umbraco/Umbraco-CMS/commit/313b831559ec21aa7bb66479eb1621f93e2fa40a
I'm no GitHub guru, just copied the guid and replaced it with another.
I have created a new issue that it generates an invalid web.config.
Priority: Normal
Type: Bug
State: Fixed
Assignee:
Difficulty: Normal
Category: Installation
Backwards Compatible: True
Fix Submitted:
Affected versions: 7.0.0
Due in version: 7.0.0
Sprint:
Story Points:
Cycle: