XBAP WPF 应用程序无法访问 app.config 中的设置
我有一个 XBAP WPF 应用程序,已经运行了一段时间。我最近在访问 app.config 中的设置时遇到问题。
对 AppSettings 的直接引用返回空字符串,而 System.Configuration.ConfigurationManager.AppSettings.Count 返回 0。此外,当尝试访问 Web 服务引用时,我收到“无法找到引用合同的默认端点元素”错误。
运行应用程序时,app.config 被复制到 app.exe.config,并且似乎没有任何差异。
有谁知道这可能发生的任何原因?唯一的变化是我最近升级到了 Windows 7 机器。我可能缺少一个组件吗?一位同事在他的机器上使用相同的操作系统运行相同的应用程序,没有出现任何问题。
谢谢。
I have an XBAP WPF application that has been working for some time now. I am recently having problems accessing settings within the app.config.
Direct references to AppSettings return empty strings, and System.Configuration.ConfigurationManager.AppSettings.Count returns 0. Also, when trying to access a web service reference I get a "Could not find default endpoint element that references contract" error.
The app.config is copied to app.exe.config when running the application and there do not appear to be any differences.
Is anyone aware of any reason this might happen? The only change is that I have recently upgraded to a Windows 7 machine. Could I be missing a component? A colleague has run the same application on his machine with the same operating system with no problems.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论