Re: Refusing all permissions
From: Eugene V. Bobukh [MS] (eugenebo_at_online.microsoft.com)
Date: 07/07/03
- Next message: Keith Patrick: "Re: Refusing all permissions"
- Previous message: Keith Patrick: "Re: How to protect intellectual property?"
- In reply to: Keith Patrick: "Refusing all permissions"
- Next in thread: Keith Patrick: "Re: Refusing all permissions"
- Reply: Keith Patrick: "Re: Refusing all permissions"
- Reply: Keith Patrick: "Re: Refusing all permissions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 7 Jul 2003 11:07:40 -0700
Well, I guess in order to run assembly requires at least one permission, that is permission to execute. So what you probably need is the following:
[assembly: SecurityPermissionAttribute(SecurityAction.RequestMinimum, Execution = true)]
[assembly:PermissionSetAttribute(SecurityAction.RequestOptional, Unrestricted = false)] // Note that it is FALSE here
Also, depending on the version of the Runtime, it may happen that the single attribute you used below could be just ignored, there were couple of weirdnesses in declarative attributes handling for such corner cases [I beleive they are fixed now].
If you truly need to refuse even execution for some reason, replace the first line with this:
[assembly:PermissionSetAttribute(SecurityAction.RequestMinimum, Unrestricted = false)]
-- Eugene V. Bobukh This message is provided "AS IS" with no warranties, and confers no rights. Any opinions or policies stated within it are my own and do not necessarily constitute those of my employer. ---- "Keith Patrick" <richard_keith_patrick@hotmail.com> wrote in message news:eb4swWJRDHA.2480@tk2msftngp13.phx.gbl... > Does anyone know how to "properly" declare that an assembly requires no > permissions whatsoever to run? What I want to do is have my base library do > this, and then consumers of the library do the same, but selectively and > explicitly activate the permissions it needs. What I had been doing is > this: > [assembly:PermissionSet(SecurityAction.RequestOptional, Unrestricted=false)] > > However, when I manually follow it with various attributes where I say > RequestMinimum/Unrestricted=true, my WIndows service still will not run, and > I've requested every permission I can find. The only thing that allows my > service to run is following the aforementioned code with: > > > > [assembly:PermissionSet(SecurityAction.RequestOptional, Unrestricted=true)] > >
- Next message: Keith Patrick: "Re: Refusing all permissions"
- Previous message: Keith Patrick: "Re: How to protect intellectual property?"
- In reply to: Keith Patrick: "Refusing all permissions"
- Next in thread: Keith Patrick: "Re: Refusing all permissions"
- Reply: Keith Patrick: "Re: Refusing all permissions"
- Reply: Keith Patrick: "Re: Refusing all permissions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|