M
Martin Lapierre
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"); }
}
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"); }
}