locked
Can't find dataConfig section RRS feed

  • Question

  • User1094618744 posted
    I am trying to build a solution with one web application and another class module. I created my sections in the Configuration console and created the App.config and dataconfiguration.config files. I then copied those files to my class project and added the files to the project. When I run my project I get this message

    Invalid section name. The section 'dataConfiguration' does not exist in the requested configuration file 'c:/inetpub/wwwroot/PServices/web.config' or the file 'c:\windows\microsoft.net\framework\v1.1.4322\Config\machine.config'. Make sure that the 'enterpriseLibrary.configurationSections' configuration section exists in one of the files and that the section 'dataConfiguration' is defined.

    Should the files be in the WebApplication? I don't want the web app to know anything about the database. Did I put the files in the wrong place, or do I need to do some more file editing? I am confused. Any help would be great.
    Thanks,
    Berney

    App.config looks like this
    <configuration>
     <configSections>
      <section name="enterpriselibrary.configurationSettings" type="System.Configuration.IgnoreSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
     </configSections>
     <enterpriselibrary.configurationSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" applicationName="Portal Account Administration" xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/configuration">
      <configurationSections>
       <configurationSection name="dataConfiguration" encrypt="false">
        <storageProvider xsi:type="XmlFileStorageProviderData" name="XML File Storage Provider" path="dataConfiguration.config" />
        <dataTransformer xsi:type="XmlSerializerTransformerData" name="Xml Serializer Transformer">
         <includeTypes />
        </dataTransformer>
       </configurationSection>
      </configurationSections>
      <keyAlgorithmStorageProvider xsi:nil="true" />
     </enterpriselibrary.configurationSettings>
    </configuration>

    and data config looks like this.
    <?xml version="1.0" encoding="utf-8"?>
    <dataConfiguration>
      <xmlSerializerSection type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data">
        <enterpriseLibrary.databaseSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" defaultInstance="Database Instance" xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/data">
          <databaseTypes>
            <databaseType name="Sql Server" type="Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase, Microsoft.Practices.EnterpriseLibrary.Data, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null" />
          </databaseTypes>
          <instances>
            <instance name="Database Instance" type="Sql Server" connectionString="CS_AccountAdmin" />
          </instances>
          <connectionStrings>
            <connectionString name="CS_AccountAdmin">
              <parameters>
                <parameter name="database" value="PSD2" isSensitive="false" />
                <parameter name="Integrated Security" value="True" isSensitive="false" />
                <parameter name="server" value="md-01" isSensitive="false" />
              </parameters>
            </connectionString>
          </connectionStrings>
        </enterpriseLibrary.databaseSettings>
      </xmlSerializerSection>
    </dataConfiguration>
    Thursday, November 17, 2005 12:20 PM

All replies

  • User-1355649840 posted
    If you didn't add the dataConfiguration.config file to the project, then it didn't get copied to the bin directory during the build. Try copying it there manually and see if it works.
    Friday, November 18, 2005 8:30 AM