Is there a command or setting for the child web.config to ignore the parent web.config

I had a problem with web.config in a child project that has the same connection string string as the parent. We have this in several of our web applications, but there is one case where we want the child to not use the parent web.config. Is there a parameter or command in the child web.config file to ignore the parent web.config?

+3
source share
4 answers

If I understand your question correctly, you can also <clear />remove all previously defined connection strings from your child website. web.config:

<configuration>
  <connectionStrings>
    <clear/>
    <add name="definedInParentButRedefinedHere" etc="..." />
  </connectionStrings>
</configuration>
+4
source

web.config , :

<location inheritInChildApplications="false">
<system.web>
...
</system.web>
</location>
+3

, , :

<connectionStrings>
    <remove name="DB2"/>
    <add name="DB2"
         providerName="System.Data.Odbc"
         connectionString="Database=DEVDB;Uid={0};Pwd={1};"/>
</connectionStrings>
+2

configuraiton . config vlaue, web.config, . , ! , , pareant .

0

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


All Articles