SecurityException using ApplicationSettingsBase on a network share

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created an application which saves the size and location of the main
form using a custom settings class derived from ApplicationSettingsBase. It
runs fine locally, and saves and retrieves the settings.

When I run the application from a network share, a SecurityException is
thrown, when the application attempts to retrieve the user settings from the
user.config file.

What attribute or code do I need to add to allow the application to read and
write to the user.config file?
 
Your assembly is presumably lacking FileIOPermission for the user.config
file when run from the network. See
http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx for an
explanation of why the behaviour differs for local vs network execution, as
well as some approaches for granting the missing permission(s) to your
assembly when run from the network.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top