none
An error occurred creating the configuration section handler RRS feed

  • Question

  • Hi,

    I have created one VSIX extension in VS 2017.

    I have one config file from where I am reading one dll to start my application. It works fine still I changed by dll assembly version.

    Lets say, I have working config file having dll assembly version 1.0.0.0 which works for me.

    Now, I have changed my code and updated dll assembly version to 1.1.0.0. When I am loading my dll it gives me error like "An error occurred creating the configuration section handler" for my assembly dll available in config file.

    When I changed my config file by updating dll verson to 1.1.0.0 then it works for me. BUT

    I don't want to do any change config file not manually and not auto.

    How can I solve this.


    Tuesday, June 18, 2019 10:27 AM

All replies

  • Hi Rohit Kanugo,

    >>I don't want to do any change config file not manually and not auto.

    What does this mean? Do you want to change it manually or auto?

    >>An error occurred creating the configuration section handle

    For this error message, how do you set the configuration section? Please provide more details.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 19, 2019 9:23 AM
    Moderator
  • Below is my congif section.

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <configSections>
            <section name="ConfigReader" type="ConfigReader.Section, ConfigReader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
        </configSections>
        <ConfigReader networkFilePath="C:\MyData.config">
        </ConfigReader>
    </configuration>

    Here, my ConfigReader dll have Version=1.0.0.0. But in my application I have changed the version to 1.0.0.1. And I am reading this file with below code.

    Shared Function OpenConfigurationFile(ByVal fileName As String) As Configuration
      Dim fileMap As ConfigurationFileMap
      Dim config As System.Configuration.Configuration
      Dim ret As Configuration
      Try
       
        fileMap = New ConfigurationFileMap(fileName)
        config = System.Configuration.ConfigurationManager.OpenMappedMachineConfiguration(fileMap)
       
       ret = New Configuration(config)
       Return ret
      Catch ex As Exception
       Throw
      End Try
     End Function

    Thursday, June 20, 2019 4:23 AM
  • Did you try a simpler definition: <section name="ConfigReader" type="ConfigReader.Section, ConfigReader"/>?

    Thursday, June 20, 2019 5:24 AM
  • Yes,  I tried with this and it works for me. But I don't want to change or update my config file.

    Also changing config file will not work as config file is already present in multiple machines on customer site.

    Thursday, June 20, 2019 8:32 AM
  • Any updates or any other solution for this...??
    Tuesday, June 25, 2019 4:14 AM
  • Hi Rohit Kanugo,

    >>Also changing config file will not work as config file is already present in multiple machines on customer site.

    Do you mean you want to change all the clients' version? If yes, how do you deploy the app on your clients? You could do some changes with the update of your app using ClickOnce or Windows installer.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 26, 2019 8:16 AM
    Moderator
  • I have deployed my changes to client last time and client has installed this file on their multiple machine.

    Now I have changes the content of the config file and client have their old config file with their changes. If I replace my changes  then client changes will get removed.

    So I need some solution so that ,client changes will not be affected and my changes also work.

    Is this is only solution you have to remove version from config file...?

    Friday, June 28, 2019 6:47 AM
  • Hi Rohit Kanugo,

    As I know, when you do the changes on your server and want to submit to clients. All the changes on clients would be changed as well.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, July 2, 2019 9:11 AM
    Moderator