You might follow the excellent advice at
http://instinctcoder.com/how-
and end up with something like this:
<?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=b99a9c59999e099">
<section name="ReportClient.My.MySettings" type="System.Configuration.ClientSettingsSection,System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b99a9c59999e099" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<applicationSettings>
<ReportClient.My.MySettings>
<setting name="SqlServerName" serializeAs="String">
<value>test123</value>
</setting>
<setting name="MainDbName" serializeAs="String">
<value />
</setting>
<setting name="ReportDbName" serializeAs="String">
<value />
</setting>
</ReportClient.My.MySettings>
</applicationSettings>
</configuration>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b99a9c59999e099">
<section name="ReportClient.My.MySettings" type="System.Configuration.ClientSettingsSection,System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b99a9c59999e099" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<applicationSettings>
<ReportClient.My.MySettings>
<setting name="SqlServerName" serializeAs="String">
<value>test123</value>
</setting>
<setting name="MainDbName" serializeAs="String">
<value />
</setting>
<setting name="ReportDbName" serializeAs="String">
<value />
</setting>
</ReportClient.My.MySettings>
</applicationSettings>
</configuration>
The trouble is that that the config files are so complicated, it is easy to lose track.
The best thing in this case is to add the following right after the end of </configSections>
<appSettings>
<add key="SqlServerName" value="test123" />
<add key="MainDbName" value="" />
<add key="MainDbName" value="" />
<add key=="ReportDbName" value="" />
</appSettings>
and when you are happy, remove the
No comments:
Post a Comment