Custom CodeAccessSecurityAttribute

From: Martin Lapierre (lapierrem_at_cedrom-sni.com)
Date: 10/29/03


Date: Wed, 29 Oct 2003 17:46:44 -0500

I try to make a custom CodeAccessSecurityAttribute, but hit the wall at
every corner.

I created a simple custom security attribute, which is working (see below).
But...
1) I have to put the assembly in "C:\Program Files\Microsoft Visual Studio
.NET 2003\Common7\IDE": shoudn't it be the application's directory instead?
2) I'm unable to debug it.

Any clues as how to change the required directory and how to debug the
assembly?

(The goal is, in the end, to access a database in the attribute.)

Thanks!

Martin

==== Code ====

 [AttributeUsage(AttributeTargets.Method)]
 public class CustomPermissionAttribute : CodeAccessSecurityAttribute
 {
  public CustomPermissionAttribute(SecurityAction action)
   : base(action)
  {}
  public override IPermission CreatePermission()
  { return new PrincipalPermission("john", "role"); }
 }



Relevant Pages

  • Re: Custom CodeAccessSecurityAttribute
    ... implementation in the GAC and add it to the fully trusted assemblies list ... > I try to make a custom CodeAccessSecurityAttribute, ... > 2) I'm unable to debug it. ...
    (microsoft.public.dotnet.security)
  • Re: Need Help Debugging
    ... you should use straight and plain ADPlus.VBS from the debugger package. ... debug info loaded, etc... ... does that avoid using the stack ?!? ... which is our custom CRITICAL_SECTION class. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Web Deployment Project Questions
    ... If you go into the IDE and set debug info to none, it should not create the PDB. ... I have been using a web deployment project with Visual Studio 2008 ... but I get an error when I try to replace my custom section. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: DOS debug.exe and 16-bit I/O?
    ... I'm working on a custom ISA board, and want to use the MS-DOS ... > "debug" command as one option to buzz it out. ... > with the driver software that was written for it, ...
    (comp.os.msdos.programmer)
  • Re: DOS debug.exe and 16-bit I/O?
    ... I'm working on a custom ISA board, and want to use the MS-DOS ... > "debug" command as one option to buzz it out. ... > driver software that was written for it, ...
    (comp.os.msdos.programmer)