FileIOPermissions issue - howto fix?
Date: Sat, 19 Jul 2003 14:17:47 -0400
My application uses components and controls contained in a control library
which works fine on my home system. When I installed the application on our
local network a twork, one of the controls (A logging window with a
control and edit/save capabilities) disappears from the main form. When I
drag the "LogWindow" control from the toolbox and drop it on my form I
receive the following error message:
"...The exception was "Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0,
Trying to debug this it appears that the culprit is the SaveFileDialog
component (if I comment out the code associated with this component in the
library, I can drop a "LogWindow" onto my form.
I check permissions on the drive and either as myself, or logged-in as
full access to the drive.
What I find perplexing is that I can drop and use a SaveFileDialog control
directly on my form, but if it is contained with a control in a library I
In order to temporarily fix this, I used the Security Adjustent Wizard and
set the trust level to "Full Trust" for the Local Intranet, but I only want
to do this until I can understand how to do it right.
My questions are:
1) What application/assembly needs a trust level "boost" in order to drop a
control from a control library onto a form in VS2003 in design mode? Do I
need to do something with the mscorlib assembly? Or is there some attribute
I need to tag the user control library with in order to work in design mode
(I can understand that maybe the program wouldn't run without proper
permissions, but why can't I design the application?)
2) If I created a "group" with all the necessary privileges, how does my
program "execute" as under the elevated permissions, while allowing the user
to run other applications under their normal permissions - an example would