.net - 在 Windows Server 2003 中通过 configSource 访问 AppSettings 时出现问题

标签 .net windows-server-2003 configsource

根据MSDN documentation , configSource 在 Windows Server 2003 SP2 上受支持。但是,当我尝试使用以下语法访问设置时:

System.Configuration.ConfigurationManager.AppSettings["SettingName"];

然后返回null。但是,同一应用程序可以在 Windows 7 和 Windows XP 上正常运行(即,AppSettings["SettingName"] 在使用 configSource 时返回预期值)。

configSource 指向的文件肯定存在,因为我将整个应用程序目录从 Windows 7 复制到 Server 2003 进行测试。

有什么想法吗?

最佳答案

您的应用程序 list 文件不完整。您需要添加“assemblyIdentity”元素。详情here 。还有一个 MS Connect 错误 here .

关于.net - 在 Windows Server 2003 中通过 configSource 访问 AppSettings 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3319584/

相关文章:

.net - 从 DispatcherObject 继承的类是线程安全的还是线程不安全的?

asp.net-2.0 - 部署网站时相对路径不起作用

c# - 如何在 asp.net 和数据库是 mysql 中使用 datetime 数据类型传递空值?

.net - 我的app.config文件出了什么问题?

iis - IIS 6.0/Windows 2003 和 IIS 7.0/Windows 2008 之间的差异

asp.net - iisreset之后无法启动应用程序池

.net - 使用 configSource,并更改核心部分的 restartOnExternalChanges

c# - 为 bindingRedirects 定义单独的 configSource 并在 app.config 中引用它

web-config - 使用 elmah 的外部配置文件

c# - Bitmap.Save "Object is currently in use elsewhere"线程问题