none
The error "configuration system failed to initialize" occurred RRS feed

  • Question

  • Hi

    When I converted and built the solution file that was developed by Visual Studio .net 2003 using Visual Studio 2005, the application program was abnormal-ended at the following step:

    m_TCPChannel = New System.Runtime.Remoting.Channels.Tcp.TcpChannel(tcp_properties, Nothing, Nothing)

    The error message was "configration system failed to initialize".  The Exception.ToString said that the root <configuration> tag was not included in the configuration file. Therefore, I changed <configopt> tag to <configuration> tag in the app.config file of the target project, and then executed again. Next time, the application program was abnormal-ended by the unrecognized section <xs:schema>. Therefore, I changed the app.config file to the simple one (only <configuration> and </configuration> tags), and then executed again. The error didn't occur.

    app.config file is copied as XXXX.exe.config into the same folder with XXXX.exe.

    I think ...
    When running on Windows XP and .NET Framework 1.1, XXXX.exe.config is not checked (or initilized) at the above TcpChannel step. However, when running on Windows 7 and .NET Framework 2.0, RFID.exe.config is checked (or initialized) at the above TcpChannel step.

    I think there are the differences of behavior between .NET Framework 1.1 and .NET Framework 2.0. Is my guessing correct?

    app.config file:
     
    <?xml version="1.0" standalone="yes"?>
     <configopt>
     <xs:schema id="configopt" xmlns="" xmlns:xs="URL Link" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
     <xs:element name="configopt" msdata:IsDataSet="true" msdata:Locale="en-AU">
     <xs:complexType>
     <xs:choice maxOccurs="unbounded">
     <xs:element name="Environment">
     <xs:complexType>
     <xs:sequence>
     <xs:element name="Name" type="xs:string" minOccurs="0" />
     <xs:element name="System" type="xs:string" minOccurs="0" />
     <xs:element name="DataLibrary" type="xs:string" minOccurs="0" />
     <xs:element name="Default" type="xs:boolean" minOccurs="0" />
     <xs:element name="UserId" type="xs:string" minOccurs="0" />
     </xs:sequence>
     </xs:complexType>
     </xs:element>
     </xs:choice>
     </xs:complexType>
     </xs:element>
     </xs:schema>
     <Environment>
     <Name>Test</Name>
     <System>XXXX.COM</System>
     <DataLibrary>XXXTEST</DataLibrary>
     <Default>false</Default>
     <UserId></UserId>
     </Environment>
     <Environment>
     <Name>Production</Name>
     <System>XXXXX.COM</System>
     <DataLibrary>XXXPROD</DataLibrary>
     <Default>true</Default>
     <UserId />
     </Environment>
     </configopt>

    • Moved by Amanda Zhu Tuesday, February 25, 2014 9:16 AM better forum
    Monday, February 24, 2014 4:38 AM

Answers

  • Hello AkiraYamazaki,

    A standard config file should be:

    Web Config:

    <configuration>
    
            <configSections>
    
                <sectionGroup>
    
                </sectionGroup>
    
            </configSections>
    
            <system.web>
    
            </system.web>
    
            <connectionStrings>
    
            </connectionStrings>
    
            <appSettings>
    
            </appSettings>
    
    </configuration>
    

    App Config:

    <?xml version="1.0" encoding=    "utf-8" ?>
    
    <configuration>
    
    <appSettings>
    
        <add key="DatabasePath" value="c:\\projects\data\spider.mdb" />
    
        <add key="SupportEmail" value="webmaster-1@dotnetspider.com" />
    
    </appSettings>
    
    </configuration>
    

    The Xml file you have copied is not a config file actually. It is the XSDfile which is used to express a set of rules to which an XML document must conform in order to be considered 'valid' according to that schema.

    Please make sure you have copied the right config file.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by AkiraYamazaki Tuesday, February 25, 2014 2:43 PM
    Tuesday, February 25, 2014 9:21 AM
    Moderator

All replies

  • Hi Akira,

    Trough some consultant and discussion with support engineers of other forums, we think that your current issue is related to CLR, so we moved this thread to Common Language Runtime Internals and Architecture for better support.

    Thanks,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, February 25, 2014 9:18 AM
  • Hello AkiraYamazaki,

    A standard config file should be:

    Web Config:

    <configuration>
    
            <configSections>
    
                <sectionGroup>
    
                </sectionGroup>
    
            </configSections>
    
            <system.web>
    
            </system.web>
    
            <connectionStrings>
    
            </connectionStrings>
    
            <appSettings>
    
            </appSettings>
    
    </configuration>
    

    App Config:

    <?xml version="1.0" encoding=    "utf-8" ?>
    
    <configuration>
    
    <appSettings>
    
        <add key="DatabasePath" value="c:\\projects\data\spider.mdb" />
    
        <add key="SupportEmail" value="webmaster-1@dotnetspider.com" />
    
    </appSettings>
    
    </configuration>
    

    The Xml file you have copied is not a config file actually. It is the XSDfile which is used to express a set of rules to which an XML document must conform in order to be considered 'valid' according to that schema.

    Please make sure you have copied the right config file.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by AkiraYamazaki Tuesday, February 25, 2014 2:43 PM
    Tuesday, February 25, 2014 9:21 AM
    Moderator
  • Hi

    Today, I prepared Windows XP PC and tested the application. Just in case, I installed Visual Studio .NET 2003.

    Just as my assumption, the error did not occur at "m_TCPChannel = New System.Runtime.Remoting.Channels.Tcp.TcpChannel(tcp_properties, Nothing, Nothing)" step. I make sure that the behavior is different in .NET Framework 1.0 and .NET Framework 2.0. But it's not so critical because of only improvement of the syntax check function.

    Tuesday, February 25, 2014 9:29 AM
  • Hi Fred,

    Thank you for your advice.

    As I mentioned in my previous reply, I didn't met the error "configuration system failed to initialize" at TCChannel step when the application was running on .NET Framework 1.1 with Windows XP. I changed the App.config file to the correct manner (<configuration> ... </configuration>). Currently, I don't have no issue when the application is running on .NET FRamework 2.0 with Windows 7.

    Tuesday, February 25, 2014 2:25 PM