Update: I had a question below but actually my problem would be solved by asking a slightly different question. Why on some machines does my application throw the error:
Configuration system failed to initialize - System.Configuration - at System.Configuration.ConfigurationManager.PrepareConfigSystem()
where as on other machines it does not. The error as described also here .NET 3.5 - Configuration system failed to initialize exception is caused by a missing configSections element at the top of my app.config. Of course, the problem would be resolved by putting this section in but for some reason the app.config in my projects solution which has this section is not the one which gets created in the appdata folder once it is deployed.
Original Question:
Why would my user config file be missing this section when deployed on some machines and not others? How can I ensure it is not missing.
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="NameOfAddin_Add_in.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
Some background. I'm deploying a vsto add-in through a click once visual studio installer on win 7 machines running outlook 2007 and 2010.
The add-in reads and writes some settings to the app.config file which unlike an exe gets stored in the local users appdata folder.
On some machines however I'm getting an error "Configuration system failed to initialize - System.Configuration - at System.Configuration.ConfigurationManager.PrepareConfigSystem()" which in my case is being caused by the above missing element in the xml. However on other machines the configSections is not missing. The problem is unrelated to the Outlook version being used.