I try to make a custom CodeAccessSecur ityAttribute, 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\ID E": 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( AttributeTarget s.Method)]
public class CustomPermissio nAttribute : CodeAccessSecur ityAttribute
{
public CustomPermissio nAttribute(Secu rityAction action)
: base(action)
{}
public override IPermission CreatePermissio n()
{ return new PrincipalPermis sion("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\ID E": 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( AttributeTarget s.Method)]
public class CustomPermissio nAttribute : CodeAccessSecur ityAttribute
{
public CustomPermissio nAttribute(Secu rityAction action)
: base(action)
{}
public override IPermission CreatePermissio n()
{ return new PrincipalPermis sion("john", "role"); }
}
Comment