UnauthorizedAccessException app.config c#
First I create a setup from a project, and I install it.
When the program reads and writes from app.config, I get an UnauthorizedAccessException.This works perfect in visual studio, but with creating a setup and installing it,开发者_如何学Go it always crashes at this point. Someone who knows how to solve this?
Thanks
youll have to provide some context as to how your running it. Are you logged in as administrator? What version of windows? where is it running from? Does the error occur when reading or writing or both?
This sounds like a permissions issue. Check the permissions of the app.config file in the install folder compared to the user running it. Likely the permissions of the installed location are more restrictive than the run folder that Visual Studio uses. You can control the permissions of the installation folder and the files that are installed. Exactly how this is done depends on which installer you are using.
精彩评论