I have an application in my subfolder within wwwroot (Finance), which worked fine, but someone else installed another application not in a subfolder but in wwwrooot. So there is a web.config in the wwwroot and in my subfolder. When I run my application it no longer reads my file but rather the one in root. Regardless of whether the other application is installed incorrectly, how can I configure my application to read my file and not the root one? Any configuration in IIS or in my web.config?

Currently exists:

  • C:\inetpub\wwwroot\web.config
  • C:\inetpub\wwwroot\Finance\web.config

I try:

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

in different sections of my web.config but not working. My web.config:

<configuration>
   <appSettings>
    .......
   </appSettings>
  <connectionStrings>
    .......
  </connectionStrings>
  <system.web>
    .......
  </system.web>
  
  <system.webServer>
    .......
  </system.webServer>
  <system.web.extensions>
    .......
  </system.web.extensions>
</configuration>
1

There are 1 best solutions below

0
On

Please check if the configuration is correct, in the root's folder web.config wraps the <system.web> element with the following element:

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

and leave all other settings elements unchanged.