causes an XML parsing error in I am trying to add a small asp.net application to a ...">

Inheriting web.config: <clear / "> causes an XML parsing error in <system.webServer> <modules>

I am trying to add a small asp.net application to a subfolder of my existing website. The problem is that the root web.config file contains modules that violate my application. I want to prevent / remove Web.config inheritance.

Parent web.config

... <system.webServer> ... <modules> <add name="WwwSubDomainModule" type="BlogEngine.Core.Web.HttpModules.WwwSubDomainModule, BlogEngine.Core" /> <add name="UrlRewrite" type="BlogEngine.Core.Web.HttpModules.UrlRewrite, BlogEngine.Core" /> ... </modules> ... 

I cannot use the following location tag in the root directory because there are other subfolders where I do want to inherit. Is there a way for a child to disconnect inheritance from a parent?

 <location path="." inheritInChildApplication="false"> 

Baby web.config

 ... <system.webServer> ... <modules> <clear/> </modules> ... 

I tried using clear, but this leads to a strange parsing error: "XML parsing error: element not found. Location: ... Line number 1, Column 1:"

If I use remove for each module, I have some success. So far I am leaving at least 1 module. (No matter which) When I remove the last module, I get the same parsing error as clarity. Does anyone know why this error occurs? Is there any other way to eliminate web.config inheritance?

+4
source share
1 answer

It seems to me that the simplest solution is to configure the application as a native application, since the subfolder contains, as you referred to it, the application. You can associate users with another parent application. Just set a subfolder to redirect all requests to another application. It sounds more like an architectural problem for me, but I only guess based on a bit of information.

Another option is if your parent application references the assembly in web.config, exclude it in the child application.

My last suggestion was that you might just need to separate the source code and application links a little better and recompile.

+1
source

Source: https://habr.com/ru/post/1396638/


All Articles