0

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?

Community
  • 1
  • 1
Pat Mustard
  • 1,852
  • 9
  • 31
  • 58

2 Answers2

1

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.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
1

I resolved the issue by deleting the following folder:

C:\Users\user.name\AppData\Local\Microsoft_Corporation\ExcelAddIn.vsto_Path_somehorrible32charhash
Pat Mustard
  • 1,852
  • 9
  • 31
  • 58
  • You said "when you deploy using windows installer". I hope you know to test alpha installers on snapshotted virtual machines so you can just revert the state and not have to track down weird problems like this. I also hope you know not to test installers on your own development box. – Christopher Painter Oct 22 '13 at 11:40