Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mike Linkovich 10 posts 41 karma points
    Jun 22, 2015 @ 20:13
    Mike Linkovich
    0

    Problem running separate app in umbraco site

    I've set up Umbraco to run on a local server:

    umbraco.local

    I've also set up a separate .NET application to run at:

    umbraco.local/myapp

    Reading the forums, it seems you have to wrap the system.web and system.webServer sections of Umbraco's web.config with:

    <location path="." inheritInChildApplications="false">
      <system.web>...</system.web>
      <system.webServer>...</system.webServer>
    </location>
    

    When I do that, it almost works, except it breaks:

    umbraco.local/umbraco

    So I can't use the admin dashboard.

    The error I get is:

    HTTP Error 500.22 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

    Most likely causes:

    This application defines configuration in the system.web/httpModules section.

    So maybe the posts I read about this are out of date? Is there still a way to do this?

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 22, 2015 @ 20:46
    Tom Fulton
    0

    Hi Mike,

    This setup should definitely work, I use it on quite a few sites.

    It almost sounds like the child web.config might have a bad config setting or app pool configuration. Could that be the case?

    -Tom

  • Mike Linkovich 10 posts 41 karma points
    Jun 22, 2015 @ 21:05
    Mike Linkovich
    0

    Thanks Tom, the child site right now has no web.config, just a placeholder index.html file is all that is there.

    They are both using the same ASP.NET v4.0 application pool, which I use for a bunch of local dev sites, using .NET Framework v4.0.30319, Managed pipeline mode: Integrated.

    The child site was added with "Add application" via IIS Manager (Windows 7, IIS 7.5) as a child of the umbraco site.

    The physical path is to a directory outside of the whole umbraco site, with the alias "myapp".

    Anyway, I tried deleting the child app completely, and I still have this problem. If the location tag is in the web config surrounding the system.web & system.webServer tags, it breaks "umbraco". If I take it out, umbraco runs fine. So basically, that single change breaks the admin section.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 22, 2015 @ 21:13
    Tom Fulton
    0

    Hmm, sounds really weird. Umbraco is set to the home directory of your root IIS site, yes?

    I'm perplex at why removing the

  • Mike Linkovich 10 posts 41 karma points
    Jun 22, 2015 @ 21:25
    Mike Linkovich
    0

    Yes, I installed 7.2.6 from a zip downloaded from our.umbraco. Created a Site for it in IIS Manager, Created a DB for it in SSMS. Umbraco installed itself fine, I created an admin account, made some document types, templates, add content, upload media, etc. I can browse the pages I made.

    So all content under umbraco.local and any pages I made like umbraco.local/mypage all work.

    It only breaks umbraco.local/umbraco when I try adding the location tag to the top level web.config in order to create a child site. Weird.

    I'm using port 8080 but that shouldn't matter.

  • Mike Linkovich 10 posts 41 karma points
    Jun 22, 2015 @ 21:30
    Mike Linkovich
    0

    Here's my web.config if it helps...

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
        <section name="urlrewritingnet" restartOnExternalChanges="true" requirePermission="false" type="UrlRewritingNet.Configuration.UrlRewriteSection, UrlRewritingNet.UrlRewriter" />
        <section name="microsoft.scripting" type="Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
        <section name="clientDependency" type="ClientDependency.Core.Config.ClientDependencySection, ClientDependency.Core" requirePermission="false" />
        <section name="Examine" type="Examine.Config.ExamineSettings, Examine" requirePermission="false" />
        <section name="ExamineLuceneIndexSets" type="Examine.LuceneEngine.Config.IndexSets, Examine" requirePermission="false" />
        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false" />
    
        <sectionGroup name="umbracoConfiguration">
          <section name="settings" type="Umbraco.Core.Configuration.UmbracoSettings.UmbracoSettingsSection, Umbraco.Core" requirePermission="false" />
          <section name="BaseRestExtensions" type="Umbraco.Core.Configuration.BaseRest.BaseRestSection, Umbraco.Core" requirePermission="false" />
          <section name="FileSystemProviders" type="Umbraco.Core.Configuration.FileSystemProvidersSection, Umbraco.Core" requirePermission="false" />
          <section name="dashBoard" type="Umbraco.Core.Configuration.Dashboard.DashboardSection, Umbraco.Core" requirePermission="false" />
        </sectionGroup>
      </configSections>
    
      <umbracoConfiguration>
        <settings configSource="config\umbracoSettings.config" />
        <BaseRestExtensions configSource="config\BaseRestExtensions.config" />
        <FileSystemProviders configSource="config\FileSystemProviders.config" />
        <dashBoard configSource="config\Dashboard.config" />
      </umbracoConfiguration>
    
      <urlrewritingnet configSource="config\UrlRewriting.config" />
      <microsoft.scripting configSource="config\scripting.config" />
      <clientDependency configSource="config\ClientDependency.config" />
      <Examine configSource="config\ExamineSettings.config" />
      <ExamineLuceneIndexSets configSource="config\ExamineIndex.config" />
      <log4net configSource="config\log4net.config" />
    
      <appSettings>
        <!-- 
          Umbraco web.config configuration documentation can be found here: 
          http://our.umbraco.org/documentation/using-umbraco/config-files/#webconfig
          -->
        <add key="umbracoConfigurationStatus" value="7.2.6" />
        <add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd" />
        <add key="umbracoReservedPaths" value="~/umbraco,~/install/" />
        <add key="umbracoPath" value="~/umbraco" />
        <add key="umbracoHideTopLevelNodeFromPath" value="true" />
        <add key="umbracoUseDirectoryUrls" value="true" />
        <add key="umbracoTimeOutInMinutes" value="20" />
        <add key="umbracoDefaultUILanguage" value="en" />
        <add key="umbracoUseSSL" value="false" />
    
        <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
        <add key="webpages:Enabled" value="false" />
        <add key="enableSimpleMembership" value="false" />
        <add key="autoFormsAuthentication" value="false" />
    
        <add key="log4net.Config" value="config\log4net.config" />
    
      </appSettings>
      <connectionStrings>
        <remove name="umbracoDbDSN" />
        <add name="umbracoDbDSN" connectionString="Data Source=LINK-PC\SQLEXPRESS;Initial Catalog=umbtest;Integrated Security=SSPI;" providerName="System.Data.SqlClient" />
        <!-- Important: If you're upgrading Umbraco, do not clear the connection string / provider name during your web.config merge. -->
      </connectionStrings>
    
      <system.data>
        <DbProviderFactories>
          <remove invariant="System.Data.SqlServerCe.4.0" />
          <add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe" />
          <remove invariant="MySql.Data.MySqlClient" />
          <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" />
        </DbProviderFactories>
      </system.data>
    
      <system.net>
        <mailSettings>
          <smtp>
            <network host="127.0.0.1" userName="username" password="password" />
          </smtp>
        </mailSettings>
      </system.net>
    
      <!-- If I remove this tag it works -->
      <location path="." inheritInChildApplications="false">
        <system.web>
          <customErrors mode="RemoteOnly" />
          <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
          <httpRuntime requestValidationMode="2.0" enableVersionHeader="false" targetFramework="4.5" />
          <!--
          If you are deploying to a cloud environment that has multiple web server instances,
          you should change session state mode from "InProc" to "Custom". In addition,
          change the connection string named "DefaultConnection" to connect to an instance
          of SQL Server (including SQL Azure and SQL  Compact) instead of to SQL Server Express.
          -->
          <sessionState mode="InProc" customProvider="DefaultSessionProvider">
            <providers>
              <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
            </providers>
          </sessionState>
          <pages enableEventValidation="false">
            <controls>
              <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
              <add tagPrefix="umbraco" namespace="umbraco.presentation.templateControls" assembly="umbraco" />
              <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            </controls>
          </pages>
          <httpModules>
            <add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add name="UmbracoModule" type="Umbraco.Web.UmbracoModule,umbraco" />
            <add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core" />
            <add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web" />
          </httpModules>
          <httpHandlers>
            <remove verb="*" path="*.asmx" />
            <add verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
            <add verb="*" path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
            <add verb="*" path="umbraco/channels.aspx" type="umbraco.presentation.channels.api, umbraco" />
            <add verb="*" path="umbraco/channels/word.aspx" type="umbraco.presentation.channels.wordApi, umbraco" />
            <add verb="*" path="DependencyHandler.axd" type="ClientDependency.Core.CompositeFiles.CompositeDependencyHandler, ClientDependency.Core " />
          </httpHandlers>
    
          <compilation defaultLanguage="c#" debug="false" batch="false" targetFramework="4.5">
            <assemblies>
              <add assembly="System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
              <add assembly="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            </assemblies>
            <buildProviders>
              <add extension=".cshtml" type="umbraco.MacroEngines.RazorBuildProvider, umbraco.MacroEngines" />
              <add extension=".vbhtml" type="umbraco.MacroEngines.RazorBuildProvider, umbraco.MacroEngines" />
              <add extension=".razor" type="umbraco.MacroEngines.RazorBuildProvider, umbraco.MacroEngines" />
            </buildProviders>
          </compilation>
    
          <authentication mode="Forms">
            <forms name="yourAuthCookie" loginUrl="login.aspx" protection="All" path="/" />
          </authentication>
          <authorization>
            <allow users="?" />
          </authorization>
          <!-- Membership Provider -->
          <membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">
            <providers>
              <clear />
              <add name="UmbracoMembershipProvider" type="Umbraco.Web.Security.Providers.MembersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="4" useLegacyEncoding="true" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Member" passwordFormat="Hashed" />
              <add name="UsersMembershipProvider" type="Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="4" useLegacyEncoding="true" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
            </providers>
          </membership>
          <!-- Role Provider -->
          <roleManager enabled="true" defaultProvider="UmbracoRoleProvider">
            <providers>
              <clear />
              <add name="UmbracoRoleProvider" type="Umbraco.Web.Security.Providers.MembersRoleProvider" />
            </providers>
          </roleManager>
        </system.web>
    
        <system.webServer>
          <validation validateIntegratedModeConfiguration="false" />
          <modules runAllManagedModulesForAllRequests="true">
            <remove name="WebDAVModule" />
    
            <remove name="UrlRewriteModule" />
            <add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
    
            <remove name="UmbracoModule" />
            <add name="UmbracoModule" type="Umbraco.Web.UmbracoModule,umbraco" />
    
            <remove name="ScriptModule" />
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    
            <remove name="ClientDependencyModule" />
            <add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core" />
    
            <!-- Needed for login/membership to work on homepage (as per http://stackoverflow.com/questions/218057/httpcontext-current-session-is-null-when-routing-requests) -->
            <remove name="FormsAuthentication" />
            <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
            <add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web" />
          </modules>
    
          <handlers accessPolicy="Read, Write, Script, Execute">
            <remove name="WebServiceHandlerFactory-Integrated" />
            <remove name="ScriptHandlerFactory" />
            <remove name="ScriptHandlerFactoryAppServices" />
            <remove name="ScriptResource" />
            <remove name="Channels" />
            <remove name="Channels_Word" />
            <remove name="ClientDependency" />
            <remove name="MiniProfiler" />
    
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add verb="*" name="Channels" preCondition="integratedMode" path="umbraco/channels.aspx" type="umbraco.presentation.channels.api, umbraco" />
            <add verb="*" name="Channels_Word" preCondition="integratedMode" path="umbraco/channels/word.aspx" type="umbraco.presentation.channels.wordApi, umbraco" />
            <add verb="*" name="ClientDependency" preCondition="integratedMode" path="DependencyHandler.axd" type="ClientDependency.Core.CompositeFiles.CompositeDependencyHandler, ClientDependency.Core" />
            <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
          </handlers>
    
          <!-- Adobe AIR mime type -->
          <staticContent>
            <remove fileExtension=".air" />
            <mimeMap fileExtension=".air" mimeType="application/vnd.adobe.air-application-installer-package+zip" />
            <remove fileExtension=".svg" />
            <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
            <remove fileExtension=".woff" />
            <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
            <remove fileExtension=".less" />
            <mimeMap fileExtension=".less" mimeType="text/css" />
            <remove fileExtension=".mp4" />
            <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
          </staticContent>
    
          <!-- Ensure the powered by header is not returned -->
          <httpProtocol>
            <customHeaders>
              <remove name="X-Powered-By" />
            </customHeaders>
          </httpProtocol>
    
        </system.webServer>
      </location>
    
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    
          <!-- Old asp.net ajax assembly bindings -->
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" />
          </dependentAssembly>
    
          <!-- Ensure correct version of MVC -->
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
          </dependentAssembly>
    
          <!-- Ensure correct version of HtmlAgilityPack -->
          <dependentAssembly>
            <assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" />
            <bindingRedirect oldVersion="1.4.5.0-1.4.6.0" newVersion="1.4.6.0" />
          </dependentAssembly>
    
          <dependentAssembly>
            <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
          </dependentAssembly>
    
          <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
          </dependentAssembly>
    
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
          </dependentAssembly>
    
        </assemblyBinding>
      </runtime>
    
      <location path="umbraco">
        <system.webServer>
          <urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />
        </system.webServer>
      </location>
      <location path="App_Plugins">
        <system.webServer>
          <urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />
        </system.webServer>
      </location>
    
    </configuration>
    
  • Mike Linkovich 10 posts 41 karma points
    Jun 23, 2015 @ 18:44
    Mike Linkovich
    0

    After some more testing, it seems that this broke in 7.2.6.

    I tried a clean install, using a new DB and site. All I did was add the location tag to Web.config, and that breaks the /umbraco dashboard.

    I tried another clean install using version 7.1.4, doing the exact same thing and it works.

    I don't know if there's some other way to run another app in a subdirectory. Unfortunately this is a showstopper for us to use Umbraco.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 24, 2015 @ 02:50
    Tom Fulton
    101

    Hi Mike,

    Thanks for the additional info. Good news, I was able to reproduce on 7.2.6 and there's an easy fix!

    In your web.config, just remove the following lines at the end:

      <location path="umbraco">
        <system.webServer>
          <urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />
        </system.webServer>
      </location>
    

    That should fix it up. I'm not exactly sure what's happening, but appears to be some sort of conflict with the

    -Tom

  • Mike Linkovich 10 posts 41 karma points
    Jun 24, 2015 @ 03:13
    Mike Linkovich
    0

    Ahh! That works, fantastic. Thanks very much!

  • Tom 23 posts 79 karma points
    Aug 05, 2015 @ 10:50
    Tom
    1

    We also ran into this today, it turns out you can just add

    <validation validateIntegratedModeConfiguration="false" />
    

    So the Umbraco location becomes

    <location path="umbraco">
    <system.webServer>
      <validation validateIntegratedModeConfiguration="false" />
      <urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />
    </system.webServer></location>
    

    Instead of removing the whole section, I think it happens when wrapping the whole system.webserver section, so umbraco doesn't know to not validate the integrated config. Adding it back in tells Umbraco to behave ;)

    (You may also need to add it to the app_plugins location and any others)

Please Sign in or register to post replies

Write your reply to:

Draft