locked
aspnet_compiler.exe Issue: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. RRS feed

  • Question

  • User-1224781418 posted

    Hi all,

     I am using Visual Studio 2019 (16.6.5) for development of a application using  Umbraco 7.5.10 (with uCommerce) and my project works well on my Windows 10  Dev / VS machine.

    I have now also been able to deploy to a (Go Daddy) hosted web server and have managed to do that successfully using Visual Studio Web Deploy (Publish).

    Now I am trying to deploy in the much the same manner (using Visual Studio Web Deploy / Publish) but this time with the following options:

    • Precompile during publishing
    • DO NOT allow precompiled site to be updatable

    Using Precompile during publishing results in the build process calling aspnet_compiler.exe as follows:

    C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p C:\Clancy\A_TeraTastic\Dev\TT15\TeraTastic\obj\TTRelease\AspnetCompileMerge\Source C:\Clancy\A_TeraTastic\Dev\TT15\TeraTastic\obj\TTRelease\AspnetCompileMerge\TempBuildDir

    That is resulting in the following error:

    2>C:\Clancy\A_TeraTastic\Dev\TT15\TeraTastic\obj\TTRelease\AspnetCompileMerge\Source\bin\web.config(99,0): Error ASPCONFIG: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

    As described above, the aspnet_compiler.exe compilation activity above is all internal to the dev machine, with the source being in the VS Projects obj folder at C:\Clancy\A_TeraTastic\Dev\TT15\TeraTastic\obj\TTRelease\AspnetCompileMerge\Source, and the destination also being in the VS Projects obj folder at C:\Clancy\A_TeraTastic\Dev\TT15\TeraTastic\obj\TTRelease\AspnetCompileMerge\TempBuildDir .  The aspnet_compiler.exe cannot know whether the destination virtual directory on the destination  IIS machine is configured as an “application” or not. So I assume the error is NOT caused by a “virtual directory not being configured as an application in IIS” as suggested.

    So what else can cause this issue and how can it debug this please ?

    I have reviewed the posts at  https://stackoverflow.com/questions/2355947/error-allowdefinition-machinetoapplication-beyond-application-level but none of the solutions have worked for me.

     Any assistance understanding, debugging or fixing this issue would be appreciated.

     Thanks

     Terry Clancy

    ClanceZ

    Wednesday, July 29, 2020 7:01 PM

All replies

  • User475983607 posted

    The error usually means that you have more than one web.config in the application.  Also could indicate an IIS configuration error. 

    Wednesday, July 29, 2020 7:15 PM
  • User-1224781418 posted

    Dear Mgebhard,

    Thanks very much for your input.

    First, you mention that it could indicate an IIS configuration error.  I believe this can not be the case because, as mentioned in more detail above, the error occurs during aspnet_compiler.exe compilation with the source and destination all on the dev machine. This is before deployment to IIS and so I do not see how the aspnet_compiler.exe would have any knowledge of IIS configuration.

    Second in relation to you suggestion that the error usually means that you have more than one web.config in the application. From what I understand and is documented at https://docs.microsoft.com/en-us/previous-versions/aspnet/ms178685(v=vs.100)  it is OK and recommended to have multiple web.config files in an ASP.Net web site. Descendant files will override settings inherited from parents and ancestors for their scope. Feel free to correct any of my misperceptions

    Apparently however some sections of the web.config file are only allowed at the root of the application, but I have not been able to get a good list of which sections are only available at the root.  Any help here would be appreciated.

    In my case I have “Excluded from Project” all web.config files except the following which I believe to be required for my MVC 5 application:

    /macroScripts/web.config

    /Views/web.config

    /web.config

    I have listed those files below for reference (with sensitive info removed).

     Again, any further assistance understanding, debugging or fixing this issue would be appreciated.

     Thanks

     Terry Clancy

    ClanceZ

     

    /macroScripts/web.config

     

    <?xml version="1.0"?>

    <configuration>

     

      <configSections>

        <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

          <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />

          <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />

        </sectionGroup>

      </configSections>

     

      <system.web.webPages.razor>

        <host factoryType="umbraco.MacroEngines.RazorUmbracoFactory, umbraco.MacroEngines"/>

        <pages pageBaseType="umbraco.MacroEngines.DynamicNodeContext">

          <namespaces>

            <add namespace="umbraco" />

            <add namespace="Examine" />

          </namespaces>

        </pages>

      </system.web.webPages.razor>

     

      <appSettings>

        <add key="webpages:Enabled" value="false" />

      </appSettings>

     

     

      <system.web>

       

       <!-- CLANCY commented out the following section as a test on 28 July 2020 -->

        <!-- <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=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"

        pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"

        userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

          <controls>

            <add assembly="System.Web.Mvc, Version=5.2.3.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>

     

    /Views/web.config

     

    <?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.3.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="TeraTastic" />

            <add namespace="Umbraco.Web" />

            <add namespace="Umbraco.Core" />

            <add namespace="Umbraco.Core.Models" />

            <add namespace="Umbraco.Web.Mvc" />

            <add namespace="umbraco" />

            <add namespace="Examine" />

            <add namespace="Umbraco.Web.PublishedContentModels" />

          </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>

     

     

        <!-- Following added by Clancy 7/26/2020 -->

        <!--  <compilation>

          <assemblies>

            <add assembly="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

          </assemblies>

        </compilation>   -->

        <!--

            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=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"

            pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"

            userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

          <controls>

            <add assembly="System.Web.Mvc, Version=5.2.3.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>

     

     /web.config

    <?xml version="1.0"?>

    <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>

        <sectionGroup name="imageProcessor">

          <section name="security" requirePermission="false" type="ImageProcessor.Web.Configuration.ImageSecuritySection, ImageProcessor.Web"/>

          <section name="processing" requirePermission="false" type="ImageProcessor.Web.Configuration.ImageProcessingSection, ImageProcessor.Web"/>

          <section name="caching" requirePermission="false" type="ImageProcessor.Web.Configuration.ImageCacheSection, ImageProcessor.Web"/>

        </sectionGroup>

        <sectionGroup name="commerce" type="System.Configuration.ConfigurationSectionGroup">

          <section name="catalogConfiguration" type="UCommerce.Infrastructure.Configuration.CatalogConfigurationSection, UCommerce.Infrastructure"/>

          <section name="runtimeConfiguration" type="UCommerce.Infrastructure.Configuration.RuntimeConfigurationSection, UCommerce.Infrastructure"/>

          <section name="securityConfiguration" type="UCommerce.Infrastructure.Configuration.SecurityConfigurationSection, UCommerce.Infrastructure"/>

        </sectionGroup>

        <section name="syscache" type="NHibernate.Caches.SysCache.SysCacheSectionHandler, NHibernate.Caches.SysCache, Version=4.0.0.4000, Culture=neutral, PublicKeyToken=6876f2ea66c9f443" requirePermission="false"/>

      </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.5.10"/>

        <add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd"/>

        <add key="umbracoReservedPaths" value="~/umbraco,~/install/,~/ucommerceapi"/>

        <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"/>

        <!--Following line changed from false to true then back to false by Clancy on 27 & 28 March 2017-->

        <add key="umbracoUseSSL" value="false"/>

        <add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>

        <add key="webpages:Enabled" value="false"/>

        <!--Following line added Clancy on 24 July 2020 trying to fix Base.cshtml "The name 'model' does not exist in the current context" See https://stackoverflow.com/questions/19696963/razor-view-throwing-the-name-model-does-not-exist-in-the-current-context    -->

        <add key="webpages:Version" value="3.0.0.0" />

        <add key="enableSimpleMembership" value="false"/>

        <add key="autoFormsAuthentication" value="false"/>

        <add key="log4net.Config" value="config\log4net.config"/>

        <!--Clancy added following line 23 December 2017-->

        <!--<add key="log4net.Internal.Debug" value="true"/>-->

        <add key="owin:appStartup" value="TeraTastic.UmbracoIdentityStartup"/>

        <add key="Umbraco.ModelsBuilder.Enable" value="true"/>

        <add key="Umbraco.ModelsBuilder.ModelsMode" value="PureLive"/>

        <add key="Raven/AnonymousAccess" value="All"/>

      </appSettings>

      <connectionStrings>

       

        XXXXXXXXXXXXXXXXXXXXXXXXXX  Connection Strings Removed xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

     

      </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>

          <!--Followinng smtp section replaced by CLANCY  29 March 2017 - to support SMTP Email Sending by uCommerce-->

          <!--See also http://docs.ucommerce.net/ucommerce/v6.8/getting-started/transaction-foundation/send-email.html-->

          <!--See also https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/network/network-element-network-settings-->

          <!--Ucommerce uses standard .NET SMTP to send the e-mail so you will have to configure the SMTP server you want to use in web.config.-->

          <!--<smtp from="noreply@example.com">

            <network host="XXXXXXXXX" userName="username" password="password"/>

          </smtp>-->

          <smtp from="XXXXXXXXXXX">

                XXXXXXXXXXXXXXXXXXXXXXXXXX  Email Info Removed xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

          </smtp>

        </mailSettings>

      </system.net>

      <system.web>

        <!--Clancy added the following line on 2 Sept 2017 -->

        <trust level="Full"/>

        <!--Clancy added the following line on 27th June 2020 -->

        <!--See https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms228262(v=vs.100) -->

        <!--See http://www.abhijainsblog.com/2015/08/secure-cookie-in-aspnet-application.html   -->

        <httpCookies requireSSL="true"/>

        <!--Clancy Changed following line on `14 Aug 2017 to allow error messages to be viewable on remote machines-->

        <!--<customErrors mode="RemoteOnly"/>-->

        <customErrors mode="Off"/>

        <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>

        <httpRuntime requestValidationMode="2.0" enableVersionHeader="false" targetFramework="4.5" maxRequestLength="51200" fcnMode="Single"/>

        <!--

          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"/>

            <add tagPrefix="commerce" namespace="UCommerce.Presentation.Web.Controls" assembly="UCommerce.Presentation"/>

          </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"/>

          <remove name="FormsAuthenticationModule"/>

          <add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.Windsor, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc"/>

          <add name="UCommerceInitializeModule" type="UCommerce.Web.UI.InitializeAppsModule, UCommerce.Admin"/>

        </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 "/>

          <add verb="*" path="PaymentRequest.axd" type="UCommerce.Transactions.Payments.PaymentRequestForm, UCommerce"/>

          <add verb="*" path="PaymentProcessor.axd" type="UCommerce.Transactions.Payments.PaymentProcessor, UCommerce"/>

        </httpHandlers>

        <!--  Following change by Terry Clancy 11 July 2020   Changed  debug = from true to false

          From  https://bytes.com/topic/asp-net/answers/344335-web-config-compilation-element

          You should ALWAYS set debug = false

          in the web.config in a production application.

     

          ASP.NET code explicitly disables batch compilation when debug = true. That

          means that every page that gets hit creates its own dynamic assembly. These

          assemblies get scattered all over the address space and fragment memory.

          The result is that you dramatically increase the probability of an OOM

          exception. There are also other drawbacks such as the batch timeout value

          being ignored which can cause other problems down the chain.

     

          It's a VERY bad idea to have debug=true in a production app.

        -->

        <compilation defaultLanguage="c#" debug="true" batch="false" targetFramework="4.5" numRecompilesBeforeAppRestart="50">

          <assemblies>

     

     

            <remove assembly="System.Web.Http"/>

            <remove assembly="System.Net.Http"/>

            <!-- Next line removed by Clancy on 11 July 2020 AS A TEST  -->

            <remove assembly="Umbraco.ModelsBuilder"/>

            <remove assembly="System.Collections"/>

            <remove assembly="System.Collections.Concurrent"/>

            <remove assembly="System.ComponentModel"/>

            <remove assembly="System.ComponentModel.Annotations"/>

            <remove assembly="System.ComponentModel.EventBasedAsync"/>

            <remove assembly="System.Diagnostics.Contracts"/>

            <remove assembly="System.Diagnostics.Debug"/>

            <remove assembly="System.Diagnostics.Tools"/>

            <remove assembly="System.Diagnostics.Tracing"/>

            <remove assembly="System.Dynamic.Runtime"/>

            <remove assembly="System.Globalization"/>

            <remove assembly="System.IO"/>

            <remove assembly="System.Linq"/>

            <remove assembly="System.Linq.Expressions"/>

            <remove assembly="System.Linq.Parallel"/>

            <remove assembly="System.Linq.Queryable"/>

            <remove assembly="System.Net.NetworkInformation"/>

            <remove assembly="System.Net.Primitives"/>

            <remove assembly="System.Net.Requests"/>

            <remove assembly="System.ObjectModel"/>

            <remove assembly="System.Reflection"/>

            <remove assembly="System.Reflection.Emit"/>

            <remove assembly="System.Reflection.Emit.ILGeneration"/>

            <remove assembly="System.Reflection.Emit.Lightweight"/>

            <remove assembly="System.Reflection.Extensions"/>

            <remove assembly="System.Reflection.Primitives"/>

            <remove assembly="System.Resources.ResourceManager"/>

            <remove assembly="System.Runtime"/>

            <remove assembly="System.Runtime.Extensions"/>

            <remove assembly="System.Runtime.InteropServices"/>

            <remove assembly="System.Runtime.InteropServices.WindowsRuntime"/>

            <remove assembly="System.Runtime.Numerics"/>

            <remove assembly="System.Runtime.Serialization.Json"/>

            <remove assembly="System.Runtime.Serialization.Primitives"/>

            <remove assembly="System.Runtime.Serialization.Xml"/>

            <remove assembly="System.Security.Principal"/>

            <remove assembly="System.ServiceModel.Duplex"/>

            <remove assembly="System.ServiceModel.Http"/>

            <remove assembly="System.ServiceModel.NetTcp"/>

            <remove assembly="System.ServiceModel.Primitives"/>

            <remove assembly="System.ServiceModel.Security"/>

            <remove assembly="System.Text.Encoding"/>

            <remove assembly="System.Text.Encoding.Extensions"/>

            <remove assembly="System.Text.RegularExpressions"/>

            <remove assembly="System.Threading"/>

            <remove assembly="System.Threading.Tasks"/>

            <remove assembly="System.Threading.Tasks.Parallel"/>

            <remove assembly="System.Xml.ReaderWriter"/>

            <remove assembly="System.Xml.XDocument"/>

            <remove assembly="System.Xml.XmlSerializer"/>

            <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"/>

            <!-- Next line removed by Clancy on 11 July 2020 AS A TEST  -->

            <add assembly="Umbraco.ModelsBuilder"/>

            <add assembly="System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Collections.Concurrent, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.ComponentModel.Annotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.ComponentModel.EventBasedAsync, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <!--Next Line added by Clancy 11 Dec 2018-->

            <!--To avoid this error:  The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.  -->

            <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>

            <add assembly="System.Diagnostics.Contracts, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Diagnostics.Debug, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Diagnostics.Tools, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Diagnostics.Tracing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Dynamic.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Globalization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.IO, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Linq.Expressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Linq.Parallel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Linq.Queryable, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Net.NetworkInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Net.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Net.Requests, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.ObjectModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Reflection, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Reflection.Emit, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Reflection.Emit.ILGeneration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Reflection.Emit.Lightweight, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Reflection.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Reflection.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Resources.ResourceManager, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Runtime.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Runtime.InteropServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Runtime.InteropServices.WindowsRuntime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Runtime.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Runtime.Serialization.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Runtime.Serialization.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Runtime.Serialization.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Security.Principal, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.ServiceModel.Duplex, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.ServiceModel.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.ServiceModel.NetTcp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.ServiceModel.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.ServiceModel.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Text.Encoding, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Text.Encoding.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Text.RegularExpressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Threading, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Threading.Tasks.Parallel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Xml.ReaderWriter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Xml.XDocument, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

            <add assembly="System.Xml.XmlSerializer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

     

          </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>

        <!-- Membership Provider -->

        <membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">

          <providers>

            <clear/>

            <add name="UmbracoMembershipProvider" type="UmbracoIdentity.IdentityEnabledMembersMembershipProvider, UmbracoIdentity" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8" 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="8" 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>

        <siteMap>

          <providers>

            <remove name="MySqlSiteMapProvider"/>

          </providers>

        </siteMap>

        <!-- CLANCY removed the following line 28 July 2020 as per  https://stackoverflow.com/questions/9300927/error-to-use-a-section-registered-as-allowdefinition-machinetoapplication-beyo -->

        <!--<authentication mode="None"/>   -->

      </system.web>

      <system.webServer>

        <!-- CLANCY added following lines to enable the display of remote detailed errors ( <customErrors mode="Off" /> was not enough  -->

        <!-- See https://www.godaddy.com/help/get-detailed-errors-16085?    -->

        <httpErrors errorMode="Detailed" existingResponse="PassThrough"/>

        <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) -->

          <add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web"/>

          <remove name="FormsAuthentication"/>

          <add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.Windsor, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc"/>

          <add name="UCommerceInitializeModule" type="UCommerce.Web.UI.InitializeAppsModule, UCommerce.Admin"/>

        </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"/>

          <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>

          <remove name="OPTIONSVerbHandler"/>

          <remove name="TRACEVerbHandler"/>

          <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>

          <add verb="*" path="PaymentRequest.axd" preCondition="integratedMode" name="PaymentRequest" type="UCommerce.Transactions.Payments.PaymentRequestForm, UCommerce"/>

          <add verb="*" path="PaymentProcessor.axd" preCondition="integratedMode" name="PaymentProcessor" type="UCommerce.Transactions.Payments.PaymentProcessor, UCommerce"/>

        </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=".woff2"/>

          <mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2"/>

          <remove fileExtension=".less"/>

          <mimeMap fileExtension=".less" mimeType="text/css"/>

          <remove fileExtension=".mp4"/>

          <mimeMap fileExtension=".mp4" mimeType="video/mp4"/>

          <remove fileExtension=".json"/>

          <mimeMap fileExtension=".json" mimeType="application/json"/>

        </staticContent>

        <!-- Ensure the powered by header is not returned -->

        <httpProtocol>

          <customHeaders>

            <remove name="X-Powered-By"/>

          </customHeaders>

        </httpProtocol>

        <!-- Increase the default upload file size limit -->

        <security>

          <requestFiltering>

            <requestLimits maxAllowedContentLength="52428800"/>

          </requestFiltering>

        </security>

      </system.webServer>

      <runtime>

        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

          <!-- Added by CLANCY 7 March 2017 >>>>>>>>>>>>>>>>>>> -->

          <!--<dependentAssembly>

            <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a"/>

            <codeBase version="1.2.11.0" href="bin\ucommerce\log4net.dll"/>

          </dependentAssembly>-->

          <!-- <<<<<<<<<<<<<<<<<<< Added by CLANCY  -->

          <!-- Following line Added by CLANCY 4th Dec 2017 so Unit Test could find NHibernate.Caches.SysCache.dll  in bin\ucommerce-->

          <!--Also remember that  fuslogvw (Assembly Binding Log Viewer)  utility is helpful to debug dll issues-->

          <probing privatePath="ucommerce"/>

          <!-- 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-3.0.0.0" newVersion="3.0.0.0"/>

          </dependentAssembly>

          <dependentAssembly>

            <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>

            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>

          </dependentAssembly>

          <dependentAssembly>

            <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35"/>

            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>

          </dependentAssembly>

          <!-- Ensure correct version of HtmlAgilityPack -->

          <dependentAssembly>

            <assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral"/>

            <bindingRedirect oldVersion="0.0.0.0-1.4.9.0" newVersion="1.4.9.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="AutoMapper" publicKeyToken="be96cd2c38ef1005" culture="neutral"/>

            <bindingRedirect oldVersion="0.0.0.0-3.3.1.0" newVersion="3.3.1.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" culture="neutral"/>

            <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>

          </dependentAssembly>

          <dependentAssembly>

            <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral"/>

            <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>

          </dependentAssembly>

          <dependentAssembly>

            <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral"/>

            <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>

          </dependentAssembly>

          <dependentAssembly>

            <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral"/>

            <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>

          </dependentAssembly>

          <dependentAssembly>

            <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral"/>

            <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>

          </dependentAssembly>

          <dependentAssembly>

            <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral"/>

            <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>

          </dependentAssembly>

          <dependentAssembly>

            <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral"/>

            <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>

          </dependentAssembly>

          <dependentAssembly>

            <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral"/>

            <bindingRedirect oldVersion="0.0.0.0-6.9.9.0" newVersion="6.9.9.0"/>

          </dependentAssembly>

          <dependentAssembly>

            <!--CLANCY replaced follwoing line as test on 9 the Sept 2017-->

            <assemblyIdentity name="Lucene.Net" publicKeyToken="85089178b9ac3181"/>

            <!--<assemblyIdentity name="Lucene.Net"/>-->

            <codeBase version="3.0.3.0" href="bin\ucommerce\Lucene.Net.dll"/>

            <codeBase version="2.9.4.1" href="bin\Lucene.Net.dll"/>

          </dependentAssembly>

     

     

     

          <dependentAssembly>

            <assemblyIdentity name="Castle.Core" publicKeyToken="407dd0808d44fbdc" culture="neutral"/>

            <bindingRedirect oldVersion="0.0.0.0-3.3.0.0" newVersion="3.3.0.0"/>

          </dependentAssembly>

          <dependentAssembly>

            <assemblyIdentity name="DocumentFormat.OpenXml" publicKeyToken="8fb06cb64d019a17" culture="neutral"/>

            <bindingRedirect oldVersion="0.0.0.0-2.8.1.0" newVersion="2.8.1.0"/>

          </dependentAssembly>

          <dependentAssembly>

            <assemblyIdentity name="Moq" publicKeyToken="69f491c39445e920" culture="neutral"/>

            <bindingRedirect oldVersion="0.0.0.0-4.5.30.0" newVersion="4.5.30.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>

      <imageProcessor>

        <security configSource="config\imageprocessor\security.config"/>

        <caching configSource="config\imageprocessor\cache.config"/>

        <processing configSource="config\imageprocessor\processing.config"/>

      </imageProcessor>

      <commerce>

        <runtimeConfiguration enableCache="true" cacheProvider="NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache, Version=4.0.0.4000, Culture=neutral, PublicKeyToken=6876f2ea66c9f443" connectionString="(auto)"/>

        <catalogConfiguration defaultCultureCode="en-US" enforceCategoryNameUniquenessWithinCatalogs="true"/>

        <securityConfiguration enable="true"/>

      </commerce>

      <syscache>

        <!-- Cache catalog objects for 60 mins before refreshing -->

        <cache region="CatalogFoundation" expiration="3600" priority="5"/>

        <cache region="MarketingFoundation" expiration="3600" priority="5"/>

        <cache region="SecurityFoundation" expiration="3600" priority="5"/>

        <cache region="Backend" expiration="3600" priority="5"/>

      </syscache>

      <location path="ucommerceapi">

        <system.web>

          <httpHandlers>

            <add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>

          </httpHandlers>

        </system.web>

        <system.webServer>

          <modules runAllManagedModulesForAllRequests="true">

            <add name="UCommerceAppsInitializeModule" type="UCommerce.Web.UI.InitializeAppsModule, UCommerce.Admin"/>

            <add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core, Version=1.8.2.1, Culture=neutral"/>

          </modules>

          <validation validateIntegratedModeConfiguration="false"/>

          <handlers>

            <add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true"/>

          </handlers>

        </system.webServer>

      </location>

    </configuration>

    Wednesday, July 29, 2020 8:43 PM
  • User475983607 posted

    Again, this error is very very common.  It happens when there is more than one web.config file in an application.  A simple Google search on the error will show many examples.  We see this error on the forum when a web application is deployed to folder in wwwroot/inetpub.  Often the solution is opening IIS manager, right clinking the folder, and selecting convert to application.

    Wednesday, July 29, 2020 9:30 PM
  • User-1224781418 posted

    Mgebhard,

    OK - I will collapse my web.config files into one file and see if that helps.  I will let you know how that goes. (It still seems strange to me that this is recommended practice at https://docs.microsoft.com/en-us/previous-versions/aspnet/ms178685(v=vs.100) ) .

    As mentioned above Visual Studio "Publish", when using PreCompile,  calls aspnet_compiler.exe and throws the error before it even attempts to interact with, or copy to, the destination IIS Server. So I do not see how any configuration on the IIS Server could be to blame. 

    In any case this application was publishing and working fine on that destination server before I modified my VS Publish settings to PreCompile the application. This shows that the destination is set to be an IIS Application (not a Folder).  

    Thanks again for your continued assistance.

    Terry Clancy

    ClanceZ

    Wednesday, July 29, 2020 9:45 PM
  • User-1224781418 posted

    Dear Mgebhard,

    Summary of my findings: Thank you.  Your suggestion resolved that specific error message, thanks VERY much ! Unfortunately it also caused the UI on my web site (running on my dev machine) to get totally screwed up. So it appears that I need those other web.config files where they are. This has helped move the ball down the court and given me a lot more things to investigate.

    Details……………..

    So I attempted to reduce my web.config count from three to one, but I ran into a catch 22;

    When I collapsed them into one file I got these errors:


    3>C:\Clancy\A_TeraTastic\Dev\TT15\TeraTastic\obj\TTRelease\AspnetCompileMerge\Source\web.config(54,0): Error ASPCONFIG: Sections must only appear once per config file. See the help topic <location> for exceptions.


    2>C:\Clancy\A_TeraTastic\Dev\TT15\TeraTastic\obj\TTRelease\AspnetCompileMerge\Source\web.config(193,0): Error ASPCONFIG: Sections must only appear once per config file. See the help topic <location> for exceptions.

    When I pulled JUST the offending sections back out into their own web.config files the original error would reappear:

    2>C:\Clancy\A_TeraTastic\Dev\TT15\TeraTastic\obj\TTRelease\AspnetCompileMerge\Source\bin\web.config(99,0): Error ASPCONFIG: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

    Those offending sections that were introduced into the main web.config and caused the error “Sections must only appear once per config file “ and so were then moved back, were as follows:


    From /Views/web.config:

    <system.web>
    <pages
    validateRequest="false"
    pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <controls>
    <add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
    </controls>
    </pages>
    </system.web>

    And from /macroScripts

    <system.web.webPages.razor>
    <host factoryType="umbraco.MacroEngines.RazorUmbracoFactory, umbraco.MacroEngines"/>
    <pages pageBaseType="umbraco.MacroEngines.DynamicNodeContext">
    <namespaces>
    <add namespace="umbraco" />
    <add namespace="Examine" />
    </namespaces>
    </pages>
    </system.web.webPages.razor>

    In the end I just “Excluded From Project” the whole /macroScripts folder and the /Views/web.config and all the above errors went away. That really screwed up my web site UI but it did remove all those errors.

    With that done I got the following error which indicates that the Publish process successfully past the aspnet_compiler.exe precompilation and there is some deployment error which I will debug separately later:


    Error Web deployment task failed. (Object of type 'manifest' and path 'manifest xml hidden' cannot be created. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEPTION_WHILE_CREATING_OBJECT.)

    But before I do that I need to find a solution that avoids the bugs without screwing up my web site.  I more investigation work to do on that.

    Any help understanding how I can better combine those web.config files or how I can run while retaining the three of them in place would be appreciated.   Meanwhile I now have a lot more testing to do given this new information.

    Thanks again,

    Terry Clancy
    ClanceZ

    Thursday, July 30, 2020 7:46 AM
  • User475983607 posted

    The problem is in your application architecture.  Web.config files are inherited.   There's is one application level web.config that all other web.config file inherit.  I think the problem is you have multiple applications you are trying to stick these applications in folders under your main application.  This IIS application design will not work.  

    Thursday, July 30, 2020 11:35 AM
  • User-1224781418 posted

    Hi again Mgebhard,

    Again, thank you for your continued assistance, it is certainly appreciated.

    Yes there may be a problem with my architecture. However it is a fairly standard Umbraco / uCommerce setup and it works fine on my test machine which, as you can see in the images below does not have either /macroScripts or /Views set up as an "Application".  I do not know what is going on, perhaps the aspnet_compiler.exe interprets (incorrectly) each web.config as a seperate application.  I remain confused but will continue to investigate and will report back here with findings.

    See images below, thanks again

    Terry Clancy

    ClanceZ

    No App Folders in IIS

    No App Folders in IIS 2

    Thursday, July 30, 2020 8:49 PM
  • User475983607 posted

    I can't help you with Umbraco / uCommerce.  All I can tell you is this is a very common error due to IIS configuraiton.  Perhaps a Umbraco or uCommerce support site can help you.

    If you truly have the application working on a real text server (not you dev machine) then all you should have to do mimic the IIS configuration and copy the files and folders as is.  

    Thursday, July 30, 2020 10:06 PM
  • User-1224781418 posted

    Hi all,

    I apologize in advance for what will be a rather unsatisfactory post.

    The reason is, that I ultimately solved this problem but am now unable to identify exactly what fixed it by replicating the bug – sorry ☹

    BUT - what I can say is that it did not require the removal of my multiple (3) web.config files.  I currently have my app working fine with all three in place, in fact my application requires that these three web.config files be in place. As mentioned previously multiple web.config files is recommended practice at https://docs.microsoft.com/en-us/previous-versions/aspnet/ms178685(v=vs.100) . 

    What IS true however is that there are some elements of Web.Config files that are only allowed in the root web.config or in machine.config.  For example if you look at the “authentication Element“ spec at https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/532aee0e(v=vs.100) and look at the Element information / Configurable Locations section you will see that it CAN  be used in web.config files in the following locations:

    • Machine.config
    • Root-level Web.config
    • Application-level Web.config

    If you tried to enter some other  element in a folder below the  Root-level Web.config that was NOT allowed in the “Application-level Web.config” files then I would expect you would get the sort of error that is the subject of this post.

    To resolve the issue  I removed sections of the child web.config files until I got it working.  Then I worked on another unrelated problem as detailed at https://social.msdn.microsoft.com/Forums/vstudio/en-US/6b54bde3-75c6-41ec-938e-75abd2395429/web-deploy-excludefrompackagefolders-amp-excludefoldersfromdeployment-both-not-working-for?forum=msbuild until I fixed that, and had a fully working deployed Precompiled app.  Then I looped back and replaced each section I removed from the web.config files to trying to break it again and identify the offending component. In the end I reversed all my changes and it still worked – dang ! So I am unable to tell you exactly what the fix was but hopefully this post helps someone.  If I do identify the offending element later I will post the info back here.

    All the best

    Terry Clancy

    ClanceZ

    Tuesday, August 4, 2020 5:54 AM