Can't get a code group to work

C

Chris Cummings

I'm trying to use .Net Code Access Security. I've tried to
create a code group at the user level (using strong name
membership). Every time I run the app that is a member of
the group, I get a SecurityException and never even get
into Main(). This fails even if I set the PermissionSet of
the group to Everything. The only time I can get the app
to run is if I set the PermissionSet to Full Trust. Is
there something I need to change in security.config or
some Windows security setting I need to change?
 
C

Chris Cummings

OK, I found the reason. I have the code group flagged as
exclusive (i.e. only use the permissions of this group at
the user level). But I don't see why I can't mark it as
exclusive. The documentation says that a security
exception is thrown if the assembly is a member of more
that one exclusive group which is not the case???
 
C

Chris Cummings

Actually turning of the exclusive attribute of the code
group basically gives the assembly Full Trust from the
AllCode group, so I'm back to square one.
 
C

Chris Cummings

OK, I found out why. The assembly needs to be marked as
[assembly:AllowPartiallyTrustedCallers]
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top