Can't stop child web application from inheriting parent's web.config - asp.net

I've looked at the related questions and followed their solutions, but it's still isn't working for me. Any help is appreciated, thank you.
I have a web application added as a virtual directory (under the parent site) and converted into an application. It even has its own application pool. The parent is .net 2.0 and child is .net 4.0.
The parent's Web.Config:
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" ...>
<sectionGroup name="scripting" ...>
<section name="scriptResourceHandler" ... />
<sectionGroup name="webServices" ...>
<section name="jsonSerialization" ... />
<section name="profileService" ... />
<section name="authenticationService" ... />
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
...
</configuration>
Child's Web.Config
<configurations>
<configSections>
<clear/>
</configSections>
<connectionStrings>
...
</connectionStrings>
</configuration>
My error message:
There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined
The <clear/> doesn't work. I've also tried referencing the system.web.extensions block outside of <configSections>, and wrapping it in
<location path="." inheritInChildApplications="false">
and it still doesn't work.
I've also tried removing those sections in the child's Web.Config and it still doesn't work:
<configurations>
<configSections>
<remove name="system.web.extensions" />
</configSections>
<connectionStrings>
...
</connectionStrings>
</configuration>
At this point, I don't know what else to try. Is there a way to separate the child web application completely from the parent, but still retaining the parent's domain? I.E. I want to be able to access the child's website through www.parent.com/child.
Thanks again.

This link helped me: http://www.asp.net/whitepapers/aspnet4/breaking-changes#0.1__Toc245724860
I moved the into the root web.config (C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG). After that, I wrapped each sections in the parent's web.config with
<location path="." inheritInChildApplications="false">
and it seems to be working now.

Related

AjaxControlToolKit AjaxFileUpload...how to allow all file types and files with no extension?

I cant figure out how to get AjaxControlToolKit's AjaxFileUpload to allow uploading of all file types. I tried the below code but it doest work. Any help would be greatly appreciated.
<ajaxToolkit:AjaxFileUpload ID="AjaxFileUploader" runat="server" Width="100%" Style="padding-bottom: 10px" OnClientUploadStart="UploadStart" OnClientUploadCompleteAll="UploadEnd" AllowedFileTypes="*" AutoStartUpload="True"/>
this is what my web.config file looks like....
Here is what my config file and control markup looks like (after changes suggested by Albert D. Kallal)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="devExpress">
<section name="themes" type="DevExpress.Web.ThemesConfigurationSection, DevExpress.Web.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
<section name="compression" type="DevExpress.Web.CompressionConfigurationSection, DevExpress.Web.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
<section name="settings" type="DevExpress.Web.SettingsConfigurationSection, DevExpress.Web.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
<section name="errors" type="DevExpress.Web.ErrorsConfigurationSection, DevExpress.Web.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
<section name="resources" type="DevExpress.Web.ResourcesConfigurationSection, DevExpress.Web.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
<section name="bootstrap" type="DevExpress.Web.Bootstrap.BootstrapConfigurationSection, DevExpress.Web.Bootstrap.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
</sectionGroup>
<section name="ajaxControlToolkit" type="AjaxControlToolkit.AjaxControlToolkitConfigSection, AjaxControlToolkit" requirePermission="false" />
</configSections>
<ajaxControlToolkit additionalUploadFileExtensions="dcm," />
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler,AjaxControlToolkit" />
<add type="DevExpress.Web.ASPxHttpHandlerModule, DevExpress.Web.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" verb="GET,POST" path="DX.ashx" name="ASPxHttpHandlerModule" preCondition="integratedMode" />
<add type="DevExpress.Web.ASPxUploadProgressHttpHandler, DevExpress.Web.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" verb="GET,POST" path="ASPxUploadProgressHandlerPage.ashx" name="ASPxUploadProgressHandler" preCondition="integratedMode" />
</handlers>
<modules runAllManagedModulesForAllRequests="true">
<add type="DevExpress.Web.ASPxHttpHandlerModule, DevExpress.Web.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule" />
</modules>
<staticContent>
<mimeMap fileExtension=".dcm" mimeType="application/dicom" />
</staticContent>
</system.webServer>
<appSettings>
bla bla bla bla
...
<ajaxToolkit:AjaxFileUpload ID="AjaxFileUploader" runat="server" Width="100%" Style="padding-bottom: 10px" OnClientUploadStart="UploadStart" OnClientUploadCompleteAll="UploadEnd" AllowedFileTypes="dcm,zip" AutoStartUpload="True"/>
Ok, this is a bit of a un-documented issue.
While you "can" specify the file types that are allowed?
There are some "security" restrictions such as .msg files and a few others.
So, in web config, you can change this.
Add this right after the start in web.config, in "configuration"
like this:
<configuration>
<configSections>
<section name="ajaxControlToolkit"
type="AjaxControlToolkit.AjaxControlToolkitConfigSection, AjaxControlToolkit"
requirePermission="false"/>
</configSections>
<ajaxControlToolkit additionalUploadFileExtensions="msg" />
<appSettings>
.etc .etc. etc.
So, you MUST add the "section name", and then (and ONLY then), can you add the
additionalUploadFileExtensions part.
The ALLOWED list of file extenstions by default is this:
7z,aac,avi,bz2,csv,doc,docx,gif,gz,htm,html,jpeg,jpg,md,mp3,mp4
ods,odt,ogg,pdf,png,ppt,pptx,svg,tar,tgz,txt,xls,xlsx,xml,zip
NOTE very close, that "bmp" files are not in that list!!!
So, while you can filter/restrict/limit say zip and pdf like this:
<ajaxToolkit:AjaxFileUpload ID="AjaxFileUpload1" runat="server"
AllowedFileTypes="pdf,zip"
ChunkSize="8192"
OnClientUploadStart="UpLoadStart"
OnClientUploadComplete = "UpLoadCompleteOne"
OnClientUploadCompleteAll="UpLoadDone" ClientIDMode="Static"
ViewStateMode="Enabled"
OnClientUploadError="UpLoadError" title="" MaximumNumberOfFiles="20"
onchange="fileschanged();" />
so, in above, we ONLY allow the user pdf, zip.
However, if we added say :
AllowedFileTypes="pdf,zip,bmp,msg"
it will NOT allow this.
So, there is a biult in "list" of allowable file types.
You can change this. In web config, add this section:
<configuration>
<configSections>
<section name="ajaxControlToolkit"
type="AjaxControlToolkit.AjaxControlToolkitConfigSection, AjaxControlToolkit"
requirePermission="false"/>
</configSections>
<ajaxControlToolkit additionalUploadFileExtensions="msg" />
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />
Note carefull, the 2nd "additional" file element FIRST requires the config section above for the aj toolkit. So, look for a existing one, and if not, then add the above.
And for NO file extenstion?
This seems to work:
<ajaxControlToolkit additionalUploadFileExtensions="msg," />
Note the trailing "," in above.
As a FYI?
I believe the file "whitelist" or restrictions appeared around version 17 for the aj toolkit, and the current number is around 20 or so. (so, if you using later then version 17, then you will have to add the above to web.config to "allow" those file types regardless of the actual file types you specify for the ajaxfileupload control in the page markup.
Edit: allowing files without extensions
It turns out from testing, that web config does NOT have to be changed to allow files without extensions. The above white list of files (allowed) still remains, and if one wants to up-load say a simple "bmp" file, then one MUST change the web.config.
However, to allow files without a extension, no such changes to web.config is required, only that you use this in the list of allowed file types in the control's markup on the page.
eg:
AllowedFileTypes=",zip"
So, note the "empty" file type in above. (quite sure it has to be the first entry).
The above will thus allow up-loading of files without an extension.
Edit and follow up
It turns out that the web.config changes are NOT required to allow a file being up-loaded without a file extension.
All that is required is the in the control markup is to add a "empty" file type, say like this:
AllowedFileTypes=",zip"
So, a "empty" file type (no space) seems to work, and their is NOT a requirement to change the web config file.
However, do keep in mind that the advice about the built-in "white list" of allowed file types. This allowed list remains in effect for files with extensions.
So, for ANY type of file (extension) that is NOT in the white-list of files? Then yes, you do have to modify web.config, and then such files can be up-loaded. One can freely add "allowed" file types (extensions) to the markup tag on the page, or leave out the allowed file types attribute to allow all types of files.
In either case (using allowed file types or not attribute in markup), the allowed file type "list" has to be modified to allow files not in that default white-list of file types.
So, allowed file types tag/attribute is optional, but the allowed file types not in the above "white-list" of files requires a change to web.config for such files to be up-loaded.

Duplicate section error even after using <remove> tag in web.config for IIS

I have a site running in a subdirectory of another site. They run in separate app pools. The two sites are running different versions of Entity Framework. So in the web.config in the subdirectory I have:
<remove name="entityFramework"/>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
But even with the <remove> tag I still get this error:
Section or group name 'entityFramework' is already defined. Updates to this may only occur at the configuration level where it is defined.
I've also placed <location> tags in the parent web.config wherever possible:
<location path="." inheritInChildApplications="false">
The <location> tag is present around the parent web.config's <entityFramework> section.
And I've placed enableConfigurationOverride="false" in the applicationHost.config files for IIS (both files in System32 and SysWOW64).
How do I prevent the site in the subdirectory from seeing the parent entityFramework tag?
EDIT
IIS Version: 7.5.7600.16385
From the parent web.config:
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
l
<location path="." inheritInChildApplications="false">
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</location>
From the child web.config:
<configSections>
<remove name="entityFramework"/>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
l
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
EDIT 2
In regards to using <clear/>: this causes a series of errors about missing section declarations. If I add back ~100 lines of section declarations I get the error: An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode. The error persists even if I use <validation validateIntegratedModeConfiguration="false" /> in <system.webServer>.
Can you confirm if you tried clear instead of remove the problem still persist or not?
<configSections>
<clear/>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
You might read more here
Hope this will help you
You said that you used but in the parent web.config you posted, the path="." is missing. You're going to need that for it to block the inheritance.
Have you tried this Removeattributes
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
http://weblogs.asp.net/srkirkland/common-web-config-transformations-with-visual-studio-2010
Example 2

UrlRewriting.Net not working even with a simple rewrite

I want to make URL rewriting using UrlRewriteNet module.
While I have added all the required config settings, nothing seems to take action even for simple rewrite.
web.config:
<configuration>
<configSections>
<!-- URL Rewriting.NET -->
<section name="urlrewritingnet"
restartOnExternalChanges="true"
requirePermission="false"
type="UrlRewritingNet.Configuration.UrlRewriteSection, UrlRewritingNet.UrlRewriter" />
</configSections>
<system.web>
<httpModules>
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter"/>
</httpModules>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="UrlRewriteModule"/>
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
</modules>
</system.webServer>
<urlrewritingnet
xmlns="http://www.urlrewriting.net/schema/config/2006/07">
<rewrites>
<add name="GeneralRewrite"
virtualUrl="^~/Default.aspx"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/MyDefault.aspx"
ignoreCase="true"
/>
</rewrites>
</urlrewritingnet>
</configuration>
Nothing more is requires as far as I understand to just rewrite the Deafault.aspx page to MyDefault.aspx. So I would expect my URL from https://server.address/Project.SiteName/Default.aspx to simply become https://server.address/Project.SiteName/MyDefault.aspx.
I use development in my local IIS 7 Windows 7 development pc but the release production server will be IIS 6 thats why I included both configuration into the web.config.
Unfortunately, and where there is no error for any reason, checked the IIS and saw that the module is registered in Modules section but the engine never runs !
Is there something that I miss here?
make the above in following manner
<configuration>
<configSections>
<section name="urlrewritingnet"
restartOnExternalChanges="true"
requirePermission ="false"
type="UrlRewritingNet.Configuration.UrlRewriteSection,
UrlRewritingNet.UrlRewriter" />
</configSections>
</configuration>
then comes the rewriting sections to rewrite urls
<urlrewritingnet>
<rewrites>
your urls to rewite will mapped here.....
</rewrites>
</urlrewritingnet>
and finally need to http module which will listen to the requests.
<system.web>
<httpModules>
<add name="UrlRewriteModule"
type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
</httpModules>
</system.web>
Except this no configuration needs to done in web.config just reference the dll (mandatory)
and .xsd file for intellisense
http://blog.vizioz.com/2009/11/add-intellisense-when-using-url.html
Open Web.config and add modules
<configuration>
<system.webserver>
<modules>
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter"/>
<remove name="Session"/>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</modules>
</system.webServer>
</configuration>

"The name 'HTML' does not exist in the current context" in MVC 3 Views

I´m starting to use "MVC 3" but I´m facing some little problems. In my Views, when I code something like this:
#if(Request.IsAuthenticated) {
<text>Welcome <b>#Context.User.Identity.Name</b>!
[ #Html.ActionLink("Log Off", "LogOff", "Account") ]</text>
}
else {
#:[ #Html.ActionLink("Log On", "LogOn", "Account") ]
}
The objects like #Request and #Html is indicating an error: The name 'HTML' does not exist in the current context.
The same occurs with #Context, #ViewBag, #Layout, #Url and others.
See:
But the code is correctly compiled with no errors. The problem is that I cannot use the Intellisense with theses objects in the Views. Is it normal? (I don´t think so). What could be happening?
I have reinstalled the MVC 3 framework but the same still occurs.
Note: this is a new project from scratch, not a MVC 2 migration. This occurs both with Razor engine and ASPX.
This is the Web.Config in the Views folder:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.web>
<httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
<!--
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=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<controls>
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>
Thanks!
You could try:
Close the View with the false errors.
(Steps 2-5 are sometimes optional) Close Visual Studio
Delete the bin and obj folders in all the Projects in the Solution.
Reopen the same Solution
Rebuild the Solution
Open a different View then the one causing the errors
Close that View, hopefully you didn't see any of the similar errors in this View
Reopen the View that gave you problems earlier
I have solved this issue with the old, good, wise Microsoft default solution: reinstall all the things again.
Uninstall and Reinstall the Visual Studio 2010 and MVC 3 Framework.
Clean your solution and Under references.
Then set the follow property:
System.Web.MVC file to Copy Local = True.
All I had to do was close all views that were open in the editor and rebuild.
What worked for me was closing Visual Studio, deleting the user option files (both solution and project level), then relaunching Visual Studio.
I'm using dotnet core sdk 2.2 and Visual Studio Professional 2019.
This was caused by Visual Studio mangling code.
Code was pasted into the razor view. Visual Studio would attempt but then fail to auto-format it. Part of the failure resulted in deleting code.
Pressing ctrl+z reverted the formatting but kept the pasted code. The razor compilation errors were then fixed (The name 'Html' does not exist in the current context)
Disable format on paste (see https://stackoverflow.com/a/28053865/1462295 ) under Tools -> Options -> Text Editor -> HTML -> Advanced
For me this just seemed to be the fact that I had compiler warnings. Code would still compile and run ok but it was not until I fixed all the build warnings that my Intellisense starting working.
I tried to remove the project that is still in trouble from solution and add it back again, after which the problem had been gone.
Set the property of System.Web.MVC,Copy Local = True
In my case my Packages folder was missing including MVC and Razor so I have updated packages in packages.config, reopened the view and it worked.
All you need to do is Restart Visual Studio and check.
You could try some following point:
Close the View with the false errors.
Close visual studio.
open project again.
clean your solution
Rebuild your solution.
hopefully you will not get any of the similar errors now.
If you still have same problem. than Please check following steps.
Make sure you have web.config file inside view folder. Becuase MVC has two web.config. one for solution and other one for project.
Your web.config file will seems like this which is inside views folder.
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization"/>
<add namespace="System.Web.Routing" />
<add namespace="Your Project Name" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
<system.web>
<compilation>
<assemblies>
<add assembly="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
</system.web>
</configuration>
It worked for me. and hope for you also.
Close Visual Studio => Delete the obj and bin folders located in your project => Start Visual Studio
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
solution for this problem in web.config
I experienced this on ASP.NET MVC 4 as well, after uninstalling EntityFramework from my packages list.
I had to remove this section
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, ....
that's left on the Web.config file... at the least it removed the errors from the errors list
Apologies for the necro post.
Selecting "Build | Rebuild Solution" corrected this issue for me in Visual Studio 2015. In my case, the warnings occurred after renaming the primary namespace of a project. A rebuild set everything straight.
I'm using ASP .net core. Solved mine by upgrading Microsoft.AspNetCore.Mvc from 1.1.2 to 1.1.3.
For me, I just restarted my Visual Studios and everything got fixed.
Maybe I am a bit late to answer this question but this easy fix helped me:
Right click the file > Exclude from project.
Right click the file > Include in project.
I had this same issue in MVC 4. None of these solutions worked for me. Instead, in Windows, I went into Control Panel -> Uninstall a program. Select Microsoft ASP.NET MVC 4 in the program list. Click 'Uninstall.' A 'Microsoft ASP.NET MVC 4 Setup' wizard will display. Click 'Repair.'

MBCompression not minifying the webresouce.axd files

I'm using MBCompression on a project and the webresource.axd files aren't minifying. The HTML source is, can't figure why the webresource.axd is not.
The server is IIS 6.0 with ASP.NET 3.5 SP1 installed. It also doesn't work via Cassini. Per the readme in the source, here's what's in my web.config:
<configSections>
<sectionGroup name="Miron.web">
<section name="CompressorSettings" type="Miron.Web.MbCompression.SettingsConfigSection"/>
</sectionGroup>
</configSections>
<Miron.web>
<CompressorSettings reflectionAlloweded="true" daysInCahe="10" optimizeHtml="true" compressCSS="true" compressJavaScript="true" compressPage="true" compressWebResource="true" compressThirdParityScripts="true" enabled="true">
<excludeTypes>
<add key="" />
</excludeTypes>
<excludePaths>
<add key="" />
</excludePaths>
</CompressorSettings>
</Miron.web>
<httpModules>
<add name="PageCompressionModule" type="Miron.Web.MbCompression.PageCompressionModule"/>
<add name="WebResourceCompressionModule" type="Miron.Web.MbCompression.WebResourceCompressionModule"/>
</httpModules>
The author is answering my question at Codeplex.

Resources