Custom Configuration Section can only be saved/modified while running as administrator?

前端 未结 1 1100
感情败类
感情败类 2021-01-27 00:01

I wrote a custom configuration section, collection, and element to add/modify to my app.config. All seems to be going well and it works perfectly running in Visual Studio. How

相关标签:
1条回答
  • 2021-01-27 00:43

    I'm not a fan of using methods in the System.Configuration namespace to write to config files. Reading values using methods in the System.Configuration namespace is never a problem.

    Just use LinqToXML instead, at least to check if that is the problem.

    I'm guessing your app is installed in C:\Program Data so while it could be permissions related I suspect the root cause of the System.Configuration.ConfigurationErrorsException: Unable to save config to file is a lock on the file, use this code to check if that assumption is correct.

    0 讨论(0)
提交回复
热议问题