简体   繁体   English

无法从app.Config读取设置

[英]Unable to read settings from app.Config

I have an addin that is installed on various user's machine and on most it is working fine. 我有一个安装在各种用户计算机上的插件,并且在大多数情况下都可以正常工作。 But for few users it is unable to load the settings from config file. 但是对于少数用户,它无法从配置文件中加载设置。 The file name is xxAddin.dll.config and it has some key and values pairs. 文件名为xxAddin.dll.config ,它具有一些键和值对。 eg 例如

?xml version="1.0" encoding="utf-8" ?
configuration
  appSettings
    add key="KeywordDBPath" value="somepath" 
    add key="keywordServer" value="someserver" /
  /appSettings
/configuration

For most of the machines this is installed on, it works fine. 对于安装在其中的大多数计算机,它都可以正常工作。 But for few users the key values return null . 但是对于少数用户,键值返回null

I have checked for config file in the installation folder and it exists and has the same contents. 我已经检查了安装文件夹中的配置文件,该文件存在并且内容相同。 To be sure that installation was not corrupt, the application was installed again but no success. 为确保安装未损坏,再次安装了该应用程序,但未成功。

I have tried looking up on various forums but none of the suggestions has helped so far. 我尝试在各种论坛上查找,但到目前为止,这些建议都没有帮助。 Any suggestion or help would be appreciated. 任何建议或帮助,将不胜感激。

Just a guess but if it works for WinXP users and not for vista or Win7 users it's because of the user permissions but this should give a exception in your application. 只是一个猜测,但是如果它适用于WinXP用户而不适用于vista或Win7用户,那是由于用户权限,但这应该在您的应用程序中出现异常。 Are you swallowing the exception? 您正在吞下例外吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM