【发布时间】:2011-01-30 03:13:52
【问题描述】:
在我的 .NET 2.0 WinForms 应用程序的终端服务器安装中,我的一个客户端在启动时出现以下异常: “无法识别的配置部分连接字符串” 这发生在 myapp.exe.config 中,但我不知道为什么。在其他任何地方都可以完美运行,此安装与其他安装的唯一区别是连接字符串。
我四处搜索,但只能在 web.config 中找到与 ASP.NET 应用程序和问题有关的这个问题。 有什么想法可以在这个 WinForms 应用程序的配置中被破坏吗?是否表明 machine.config 中存在问题?
仅供参考,myapp.exe.config 的顶部是:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="MyApp.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="MyApp.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings>
<add name="MyApp.DataAccessLayer.Settings.MyConnectionString" connectionString="$$$$$$" providerName="System.Data.SqlClient" />
</connectionStrings>
...
谢谢
理查德
【问题讨论】:
标签: .net winforms configuration app-config