We have moved to GitHub Issues
Created by Mikael Syska 21 Nov 2013, 22:19:46 Updated by Shannon Deminick 26 Nov 2013, 09:03:31
This is the web.config generated:
<!-- 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=188.8.131.52, Culture=neutral, PublicKeyToken=31BF3856AD364E35" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=184.108.40.206, Culture=neutral, PublicKeyToken=31BF3856AD364E35" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <controls> <add assembly="System.Web.Mvc, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" /> </controls> </pages>
<handlers> <remove name="BlockViewHandler"/> <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" /> </handlers>
Missing this part:
Steps to reproduce please? Works fine for me.
Steps to reproduce:
Why would you delete the web.config file from the views folder??
Assigning to Shannon as it's writing the wrong web.config file to the views folder, not sure where that code would live.
It all started from a previous bug, when the installer did not add the correct "web.config" to the Views folder for some reason when installing from NuGet in VS 2013 into an Empty Web Project.
But no ... I would not delete, but I think we might just as well have it fixed now. I don't have 2013 at this computer so not sure if it's still an issue in 2013. But I will test it later today.
It's an issue with any VS as it's our code that writes the web.config file.
That's what makes it very odd since it's correct when installing but wrong when it's done at runtime of the website. I think someone mentioned that it was done by the ViewEngine if it's missing.
When it's installing it just uses a file in the NuGet package. When recreating it uses some code to write a new file, so it's not odd that those files wouldn't match up as it's two completely separate things.
It's true, the umbraco view engine will create this file if it doesn't exist. Perhaps this is part of the issue? The reason it did this was when we first released 4.10 with MVC so when people upgraded it would be seamless (no config changes).
The code that does this is in Umbraco.Web.Mvc.RenderViewEngine.EnsureFoldersAndFiles
The web.config it writes out is in:
Umbraco.Web.Mvc.Strings.web_config resource (found at this proj location - Umbraco.Web.Mvc.web.config.templates)
confirmed, the gen'd config is old :(
I'm just going to remove the generated config since we don't have to worry about it since we ship with it.
Actually... now I realize another reason why we had this, it's to also ensure that a correct web.config is generated in any ~/App_Plugins/MyPackage/Views folder if package devs forget to ship it. I'll just make sure the gen'd one is correct.
How can we make sure it's always up-to-date? One single source of the truth please.
yes, will do
actually sorry, i cannot do that. that is impossible because they exist in different projects. So either we don't ship with this web.config and rely on having it generated every time or we remove the generation, or we have it duplicated.
I guess the other option is to have a shared asset (linked file), that might work.
that worked, 2391ee1368762eacfe27795a07a73014fcf1a54e
Assignee: Shannon Deminick
Backwards Compatible: True
Affected versions: 7.0.0
Due in version: 7.0.1