What do these Visual Studio warnings mean?

My Web.Config broadcasts are not published - and I think the error is related to these warnings that I receive.

Using Visual Studio 2010, I play with my file Web.Config/ Web.Config.Debug.

In my file, .DebugI get the following warning, indicated many times.

No element in the source document matches '/configuration'

I think it lists it for each section that exists in the file .Debug.

So, with the following sample Web.Config.Debug file, which will be listed twice. (I guess the first for <connectionStrings>..</>, and the second for <system.webServer>...</.>)

<?xml version="1.0"?>

<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" xdt:SupressWarnings="false">

    <connectionStrings>
        <add name="Foo" connectionString="Server=foo;Database=Foo;uid=foo;password=foo" providerName="System.Data.SqlClient"
            xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
    </connectionStrings>

    <system.webServer>
        <httpProtocol>
            <customHeaders>
                <clear />
                <add name="ETag" value="Dev_IIS" xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
            </customHeaders>
        </httpProtocol>
    </system.webServer>

</configuration>

Can anyone help please?

+3
2

, , xmlns = attributes.

Web.config :

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <connectionStrings>
    etc...

:

<configuration>
  <connectionStrings>
    etc...

... , !

+3

- (target.net 4.0), Web.Release.config, , . web.config :

    <add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />
    <add name="Foo" />  <------------------------added this
  </connectionStrings>

, -. web.config

<add name="ApplicationServices"
     connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
     providerName="System.Data.SqlClient" />
<add name="Foo"
     connectionString="Server=foo;Database=Foo;uid=foo;password=foo"
     providerName="System.Data.SqlClient" />  <-------this got added

, .

0

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


All Articles