In my C # form application (created in VS2010 using .NET 4.0), I use the application parameter to store the output path.
This setting was previously configured with a user area, but I had to change its scope.
After that, I now get the Unrecognized configuration section userSettings error message when the form starts (note that the program was executed before the configuration area was set by the user):
InnerException: System.Configuration.ConfigurationErrorsException Message=Unrecognized configuration section userSettings. (C:\Documents and Settings\Administrator\Local Settings\Application Data\CallCenterForm\CallCenterForm.vshost.exe_StrongName_bplf30wziudnpq0knzaacfuyomd5rv45\1.0.0.0\user.config line 3) Source=System.Configuration BareMessage=Unrecognized configuration section userSettings. Filename=C:\Documents and Settings\Administrator\Local Settings\Application Data\CallCenterForm\CallCenterForm.vshost.exe_StrongName_bplf30wziudnpq0knzaacfuyomd5rv45\1.0.0.0\user.config
So, after some lookup, this seems to be caused by the old user.config file that still exists on the system, causing the program to read it and throw an error (I'm not sure what the actual underlying problem is). I can also confirm that when the file is deleted, the problem disappears.
Which leads me to my question, is there a way to change the program so that it does not read the old user.config file, because deleting it manually is not ideal, since the program already works on several systems.
Sorry if this was covered, but I could not find the answer.
If it is useful here, the contents of my App.config file are:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <section name="CallCenterForm.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </sectionGroup> </configSections> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0"/> </startup> <applicationSettings> <CallCenterForm.Properties.Settings> <setting name="saved_output_dir" serializeAs="String"> <value>c:\</value> </setting> </CallCenterForm.Properties.Settings> </applicationSettings> </configuration>
c # app-config
dancypants
source share