Disable web.config Inheritance for Child Applications in Subfolders

Last post 11-06-2008 6:19 AM by kyle@live-it.com. 8 replies.

Sort Posts:

  • Disable web.config Inheritance for Child Applications in Subfolders

    09-27-2008, 11:44 AM
    • Member
      point Member
    • bmaloley
    • Member since 08-22-2008, 3:31 AM
    • Posts 10

     Can someone help me with this I am trying to apply what this article says but can not figure out where or how to correctly add the code it says. Can someone show me where I would place the code (my web.config code is below). http://www.aspdotnetfaq.com/Faq/how-to-disable-web-config-inheritance-for-child-applications-in-subfolders-in-asp-net.aspx

    <?xml version="1.0"?>
    <configuration>
        <configSections>
            <sectionGroup name="BlogEngine">
                <section name="blogProvider" requirePermission="false" type="BlogEngine.Core.Providers.BlogProviderSection, BlogEngine.Core" allowDefinition="MachineToApplication" restartOnExternalChanges="true"/>
            </sectionGroup>
        </configSections>
        <BlogEngine>
            <blogProvider defaultProvider="XmlBlogProvider">
                <providers>
                    <add name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core"/>
                    <add name="DbBlogProvider" type="BlogEngine.Core.Providers.DbBlogProvider, BlogEngine.Core" connectionStringName="BlogEngine" />
                </providers>
            </blogProvider>
        </BlogEngine>
        <!-- configSource is not implemented in Mono.
        <connectionStrings configSource="sql.config" />
      -->
        <connectionStrings>
            <clear/>
            <add name="LocalSqlServer" connectionString="dummy"/>
            <!-- Mono complains if LocalSqlServer isn't specified -->
            <add name="BlogEngine" connectionString="Data Source=MySQLServer;User ID=user;Password=password;persist security info=False;initial catalog=BlogEngine;" providerName="System.Data.SqlClient"/>
        </connectionStrings>
     
        <appSettings>
            <add key="BlogEngine.FileExtension" value=".aspx"/>
            <!-- You can e.g. use "~/blog/" if BlogEngine.NET is not located in the root of the application -->
            <add key="BlogEngine.VirtualPath" value="~/"/>
            <!-- The regex used to identify mobile devices so a different theme can be shown -->
            <add key="BlogEngine.MobileDevices" value="(nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)"/>
            <!-- The name of the role with administrator permissions -->
            <add key="BlogEngine.AdminRole" value="Administrators"/>
            <!--This value is to provide an alterantive location for storing data.-->
            <add key="StorageLocation" value="~/App_Data/"/>
        <!--A comma separated list of script names to hard minify. It's case-sensitive. -->
        <add key="BlogEngine.HardMinify" value="blog.js,widget.js,WebResource.axd"/>
        </appSettings>
        
      <system.web>
            <compilation debug="true">
                <assemblies>
                    <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                    <add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                    <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                    <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                    <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                    <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                    <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                </assemblies>
            </compilation>

        <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="auto" uiCulture="auto"/>
            <httpRuntime enableVersionHeader="false" useFullyQualifiedRedirectUrl="true" maxRequestLength="16384" executionTimeout="3600" requestLengthDiskThreshold="16384"/>
            <machineKey validationKey="D9F7287EFDE8DF4CAFF79011D5308643D8F62AE10CDF30DAB640B7399BF6C57B0269D60A23FBCCC736FC2487ED695512BA95044DE4C58DC02C2BA0C4A266454C" decryptionKey="BDAAF7E00B69BA47B37EEAC328929A06A6647D4C89FED3A7D5C52B12B23680F4" validation="SHA1" decryption="AES"/>
            
        <authentication mode="Forms">
                <forms timeout="129600" name=".AUXBLOGENGINE" protection="All" slidingExpiration="true" loginUrl="~/login.aspx" cookieless="UseCookies"/>
            </authentication>
            
        <pages enableSessionState="false" enableViewStateMac="true" enableEventValidation="true">
                <controls>
                    <add namespace="Controls" tagPrefix="blog"/>
                </controls>
            </pages>
            
        <customErrors mode="Off">
                <error statusCode="404" redirect="~/error404.aspx"/>
            </customErrors>
                    
        <membership defaultProvider="XmlMembershipProvider">
                <providers>
                    <clear/>
                    <add name="XmlMembershipProvider" type="BlogEngine.Core.Providers.XmlMembershipProvider, BlogEngine.Core" description="XML membership provider" passwordFormat="Hashed"/>
                    <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="BlogEngine" applicationName="BlogEngine"/>
                    <add name="DbMembershipProvider" type="BlogEngine.Core.Providers.DbMembershipProvider, BlogEngine.Core" passwordFormat="Hashed" connectionStringName="BlogEngine"/>
                </providers>
            </membership>
            
        <roleManager defaultProvider="XmlRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".BLOGENGINEROLES">
                <providers>
                    <clear/>
                    <add name="XmlRoleProvider" type="BlogEngine.Core.Providers.XmlRoleProvider, BlogEngine.Core" description="XML role provider"/>
                    <add name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="BlogEngine" applicationName="BlogEngine"/>
                    <add name="DbRoleProvider" type="BlogEngine.Core.Providers.DbRoleProvider, BlogEngine.Core" connectionStringName="BlogEngine"/>
                </providers>
            </roleManager>
            
        <siteMap defaultProvider="PageSiteMap" enabled="true">
                <providers>
                    <add name="PageSiteMap" description="The site map provider that reads in the .sitemap XML files." type="BlogEngine.Core.Web.Controls.PageSiteMap, BlogEngine.Core"/>
                    <add name="SecuritySiteMap" description="Used for authenticated users." type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" securityTrimmingEnabled="true" siteMapFile="Web.sitemap"/>
                </providers>
            </siteMap>
        
            <httpModules>
                <add name="WwwSubDomainModule" type="BlogEngine.Core.Web.HttpModules.WwwSubDomainModule, BlogEngine.Core"/>
                <add name="UrlRewrite" type="BlogEngine.Core.Web.HttpModules.UrlRewrite, BlogEngine.Core"/>
                <add name="CompressionModule" type="BlogEngine.Core.Web.HttpModules.CompressionModule, BlogEngine.Core"/>
                <add name="ReferrerModule" type="BlogEngine.Core.Web.HttpModules.ReferrerModule, BlogEngine.Core"/>
                <!--Remove the default ASP.NET modules we don't need-->
                <remove name="PassportAuthentication"/>
                <remove name="Profile"/>
                <remove name="AnonymousIdentification"/>
            </httpModules>
            
        <httpHandlers>
                <add verb="*" path="file.axd" type="BlogEngine.Core.Web.HttpHandlers.FileHandler, BlogEngine.Core" validate="false"/>
                <add verb="*" path="image.axd" type="BlogEngine.Core.Web.HttpHandlers.ImageHandler, BlogEngine.Core" validate="false"/>
                <add verb="*" path="syndication.axd" type="BlogEngine.Core.Web.HttpHandlers.SyndicationHandler, BlogEngine.Core" validate="false"/>
                <add verb="*" path="sitemap.axd" type="BlogEngine.Core.Web.HttpHandlers.SiteMap, BlogEngine.Core" validate="false"/>
                <add verb="*" path="trackback.axd" type="BlogEngine.Core.Web.HttpHandlers.TrackbackHandler, BlogEngine.Core" validate="false"/>
                <add verb="*" path="pingback.axd" type="BlogEngine.Core.Web.HttpHandlers.PingbackHandler, BlogEngine.Core" validate="false"/>
                <add verb="*" path="opensearch.axd" type="BlogEngine.Core.Web.HttpHandlers.OpenSearchHandler, BlogEngine.Core" validate="false"/>
                <add verb="*" path="metaweblog.axd" type="BlogEngine.Core.API.MetaWeblog.MetaWeblogHandler, BlogEngine.Core" validate="false"/>
                <add verb="*" path="rsd.axd" type="BlogEngine.Core.Web.HttpHandlers.RsdHandler, BlogEngine.Core" validate="false"/>
                <add verb="*" path="css.axd" type="BlogEngine.Core.Web.HttpHandlers.CssHandler, BlogEngine.Core" validate="false"/>
                <add verb="*" path="js.axd" type="BlogEngine.Core.Web.HttpHandlers.JavaScriptHandler, BlogEngine.Core" validate="false"/>
                <add verb="*" path="rating.axd" type="BlogEngine.Core.Web.HttpHandlers.RatingHandler, BlogEngine.Core" validate="false"/>
                <add verb="*" path="opml.axd" type="BlogEngine.Core.Web.HttpHandlers.OpmlHandler, BlogEngine.Core" validate="false"/>
                <add verb="*" path="blogml.axd" type="BlogEngine.Core.Web.HttpHandlers.BlogMLExportHandler, BlogEngine.Core" validate="false"/>
                <add verb="*" path="sioc.axd" type="BlogEngine.Core.Web.HttpHandlers.Sioc, BlogEngine.Core" validate="false"/>
                <add verb="*" path="apml.axd" type="BlogEngine.Core.Web.HttpHandlers.Apml, BlogEngine.Core" validate="false"/>
                <add verb="*" path="foaf*.axd" type="BlogEngine.Core.Web.HttpHandlers.Foaf, BlogEngine.Core" validate="false"/>
            </httpHandlers>
        </system.web>
    </configuration>

  • Re: Disable web.config Inheritance for Child Applications in Subfolders

    09-29-2008, 8:23 AM
    • All-Star
      77,367 point All-Star
    • jeff@zina.com
    • Member since 09-26-2003, 10:43 AM
    • Naples, FL, USA
    • Posts 10,528
    • Moderator
      TrustedFriends-MVPs

    If you're talking about using <location> to disable inheritance, it wraps whatever you want not to inherit.  So it could be anywhere within the <configuration> section and even appear multiple times.

    Jeff

    Blatant Self Promotion: ASP.NET 3.5 CMS Development
  • Re: Disable web.config Inheritance for Child Applications in Subfolders

    09-29-2008, 1:27 PM
    • Member
      point Member
    • bmaloley
    • Member since 08-22-2008, 3:31 AM
    • Posts 10

    I am not sure what I need to not inherit. I am trying to get my blog to work on my website for instance http://www.mywebsite.com/blog. This is is the error my blog page comes back with

    Source Error:                 

    Line 92:         -->
    Line 93: <httpModules>
    Line 94: <add type="BVSoftware.Bvc5.Core.Utilities.LoginPersister, BVSoftware.Bvc5.Core" name="LoginPersister"/>
    Line 95: <add type="BVSoftware.Bvc5.Core.Utilities.UrlRewriter, BVSoftware.Bvc5.Core" name="UrlRewriter" />
    Line 96: </httpModules>

     Any ideas? 

  • Re: Disable web.config Inheritance for Child Applications in Subfolders

    09-30-2008, 7:05 AM
    • All-Star
      77,367 point All-Star
    • jeff@zina.com
    • Member since 09-26-2003, 10:43 AM
    • Naples, FL, USA
    • Posts 10,528
    • Moderator
      TrustedFriends-MVPs

    Have you tried simply making the blog folder an application in IIS?

    Jeff

    Blatant Self Promotion: ASP.NET 3.5 CMS Development
  • Re: Disable web.config Inheritance for Child Applications in Subfolders

    09-30-2008, 10:13 AM
    • Member
      point Member
    • bmaloley
    • Member since 08-22-2008, 3:31 AM
    • Posts 10
    Yes that was the first thing I did when I uploaded it. I have tried to find someone locally but the amount of people who have a good influence of ASP.Net is very few. Do you have any ideas?
  • Re: Disable web.config Inheritance for Child Applications in Subfolders

    10-01-2008, 10:41 PM
    • Member
      222 point Member
    • murtaza_t
    • Member since 09-12-2008, 12:22 AM
    • Earth
    • Posts 51

     Try configuring blog application folder with a different Apllication pool other than that of mywebsite.

    Moosa.
    ---------
    eUKhost.com
    Your Search for Webhosting Ends here..
    ASP .NET - MSSQL Hosting
    Free ASP .NET - MSSQL Solutions
  • Re: Disable web.config Inheritance for Child Applications in Subfolders

    10-02-2008, 7:27 PM
    • Member
      point Member
    • bmaloley
    • Member since 08-22-2008, 3:31 AM
    • Posts 10

     How would I do that?

  • Re: Disable web.config Inheritance for Child Applications in Subfolders

    10-03-2008, 3:36 PM
    • Member
      222 point Member
    • murtaza_t
    • Member since 09-12-2008, 12:22 AM
    • Earth
    • Posts 51

    Create a new application pool and you can just right click on the blog application folder and in virtual directory tab select application pool as the one you have just created.

    Moosa.
    ---------
    eUKhost.com
    Your Search for Webhosting Ends here..
    ASP .NET - MSSQL Hosting
    Free ASP .NET - MSSQL Solutions
  • Re: Disable web.config Inheritance for Child Applications in Subfolders

    11-06-2008, 6:19 AM
    • Member
      576 point Member
    • kyle@live-it.com
    • Member since 12-05-2007, 6:06 AM
    • Cape Town , South Africa
    • Posts 216

    Are you using blog engine ?

    Kyle Isaacs
    Email : kyle@live-it.com
    Skype : kyle.isaacs01
    ______________________________________
    Please do note "FORGET" to mark post as answer if its correct
Page 1 of 1 (9 items)