Pat Mustard
Pat Mustard

Reputation: 1902

Configuration System Failed To Initialize (Not XML issue)

I have looked at many other answers here on how to solve this and all point to malformed XML in the app.config file. However, my app.config seems to have the <configSections> node in the correct place (first child node of <configuration>):

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <sectionGroup name="userSettings"
                      type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="My_Excel_Addin_Name.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <userSettings>
        <My_Excel_Addin_Name.Properties.Settings>
            <setting name="Host" serializeAs="String">
                <value />
            </setting>
            <setting name="Port" serializeAs="String">
                <value />
            </setting>
        </My_Excel_Addin_Name.Properties.Settings>
    </userSettings>
</configuration>

Is it possible that it is something to do with the name of my project containing spaces ("My Excel Addin Name")?

I also thought it may have been something to do with refactoring namespace names in VS2010 so I rebuilt my project (Excel Add In) in a new project where no refactoring was done but the issue still remains.

I have left out some user settings above but have gone through them to check for duplicates and none exist.

This only happens when I deploy the add in with a windows installer. When I build in release and run on my machine without using the installer, the issue doesn't occur.

Any ideas?

Thanks

Any ideas what could be the issue here?

Upvotes: 0

Views: 366

Answers (2)

Pat Mustard
Pat Mustard

Reputation: 1902

I resolved the issue by deleting the following folder:

C:\Users\user.name\AppData\Local\Microsoft_Corporation\ExcelAddIn.vsto_Path_somehorrible32charhash

Upvotes: 1

Christopher Painter
Christopher Painter

Reputation: 55581

Go into Visual Studio and select File | New | Item and select General | XML file. Paste the contents of your XML into this new file.

Visual Studio Intellisense will immediately inform you that your XML is malformed. Your setting[@name='Port'] element is missing it's close tag.

Upvotes: 1

Related Questions