Re: FileIOPermissions issue - howto fix?
From: Michel Gallant (neutron_at_istar.ca)
Date: 07/19/03
- Previous message: Shmulik28_at_yahoo.com: "FileIOPermissions issue - howto fix?"
- In reply to: Shmulik28_at_yahoo.com: "FileIOPermissions issue - howto fix?"
- Next in thread: Shmulik28_at_yahoo.com: "Re: FileIOPermissions issue - howto fix?"
- Reply: Shmulik28_at_yahoo.com: "Re: FileIOPermissions issue - howto fix?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sat, 19 Jul 2003 14:34:07 -0400
In the .NET CAS security manager, doesn't really matter what user permissions you
have on that network share, the code-origin is queried first and it is LocalInternet
in origin which by default has rather restricted code-execution permissions.
The safest way to enable the file permissions you need is to use a code group
based on strong-naming or Authenticode signature.
Here is a walk-through with screen shots showing how to do it for strong-naming:
http://www3.sympatico.ca/mitchg/dotnet/networkshare.html
- Michel Gallant
MVP Security
<Shmulik28@yahoo.com> wrote in message news:OoWe0FiTDHA.1664@TK2MSFTNGP11.phx.gbl...
> 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
> richtextbox
> 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,
> ..., failed.";
>
> 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
> administrator, have
> 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
> cannot.
>
> 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
> be helpful.
>
> Thanks!
>
>
>
>
>
- Previous message: Shmulik28_at_yahoo.com: "FileIOPermissions issue - howto fix?"
- In reply to: Shmulik28_at_yahoo.com: "FileIOPermissions issue - howto fix?"
- Next in thread: Shmulik28_at_yahoo.com: "Re: FileIOPermissions issue - howto fix?"
- Reply: Shmulik28_at_yahoo.com: "Re: FileIOPermissions issue - howto fix?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|