Web Deployment Tool (MS Deploy)
Web Deploy Error: "virtual directory not being configured as an appl...
Last post Aug 17, 2017 05:06 PM by terry.clancy
Aug 01, 2017 07:50 PM|terry.clancy|LINK
I am trying to use Visual Studio Publish on my Dev machine to deploy a Web Site to a separate IIS Test Server using Web Deploy and I am getting the following error which I do not understand:
Error 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. TeraTastic D:\Clancy\A_TeraTastic\Dev\TT15\TeraTastic\obj\Debug\AspnetCompileMerge\Source\app_data\nugetbackup\20170306-224002\web.config 146
Below I have listed the offending section of the referenced web.config file with offending line 146 marked with: "<<<<< ERROR LINE 146 <<<<<<<<"
<httpRuntime targetFramework="4.5.1" fcnMode="Single" maxRequestLength="51200"/>
<add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core"/>
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web"/>
<add name="UmbracoModule" type="Umbraco.Web.UmbracoModule,umbraco"/>
<add verb="GET" path="DependencyHandler.axd" type="ClientDependency.Core.CompositeFiles.CompositeDependencyHandler, ClientDependency.Core "/>
<siteMap> <<<<<<<<<<<<<<<<<<<<<< ERROR LINE 146 <<<<<<<<<<<<<<<<<<<<<<
Any assistance to understand and resolve this error would be very much appreciated.
Aug 02, 2017 06:09 AM|Yuk Ding|LINK
Do you have any backup web.config in your project? If you do have such kind of file, then IIS could report the error:
"virtual directory not being configured as an application in IIS". nugetbackup\20170306-224002\web.config really looks doesn't like an web.config for the root application. The normal virtual directory should not contain a web.config while the web application
folder do have an application level web.config. So please just remove the backup folder.
Aug 17, 2017 05:06 PM|terry.clancy|LINK
Hi again !
OK got this solved and thanks to Jeong Hwan Kim for his assistance in this:
This was caused by a violation in the configured allowDefinition for the siteMap section in the %windir%\system32\inetsrv\config\applicationhost.config
on the IIS Test server.
In this case there was actually no siteMap section in that file.
Note that in this case siteMap seems to be a custom section installed by external components.
Note that generally all the configuration section names in web.config should be defined in %windir%\system32\inetsrv\config\applicationhost.config
on the IIS Test server. Otherwise, IIS is supposed to fail because of the invalid section as a security measure.
If the section name is not defined in applicationhost.config, you should contact the owner of the specific section (such as siteMap
in this case) and notify them that the have not registered themselves in applicationhost.config and that should be fixed by the author of that section.
So in this case for example I checked
c:\Windows\system32\inetsrv\config\applicationhost.config file from the IIS Server and I did not see a <section name="siteMap" allowDefinition="MachineToApplication" … />
or in fact any reference to “sitemap” in that file.
What I should have seen is something like
<section name="siteMap" allowDefinition="MachineToApplication" … />
If it does exist, I could
adjusted the allowDefinition value with any proper one. Or, simply remove the allowDefinition
property to allow whole level for the particular section “siteMap”.
my case I solved as follows:
I edited D:\Clancy\A_TeraTastic\Dev\TT15\TeraTastic\app_data\nugetbackup\20170306-224002\web.config
and removed the following:
I hope this helps someone :-)