0

I have a website hosted in IIS (site.domain.com) and a web application hosted under it (site.domain.com/app). when trying to access site.domain.com/app it gives missing Configuration Error - Could not load file or assembly from the main website web.config!!

Why accessing the web application goes through the main website!! it should be a separate entity.

The idea is to use the main website as a login page then having links to open the web applications under it.

  • "it should be a separate entity." No, it isn't. By putting an application under a site, you explicitly configure a relationship. Applications inherit important settings from the site, so when you hit that error it is expected. If you want to avoid that, you can also, https://stackoverflow.com/questions/782252/avoid-web-config-inheritance-in-child-web-application-using-inheritinchildapplic – Lex Li Dec 28 '19 at 13:36

1 Answers1

0

The reason behind the issue is Child application is inheriting Parent applications web.config file.

To avoid this inheritance of web.config file put below code in child application:

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

or

for iis 7 and above:

<location path="." inheritInChildApplications="false"> 
  <system.webServer>
    <!-- ... -->
  </system.webServer>
</location>
Jalpa Panchal
  • 8,251
  • 1
  • 11
  • 26