> I have written an application in C# and when I distribute it I would like
to
prevent un-authorised people from using these assemblies in their own
applications.
Is it possible to do this?
Yes
Add this (assuming that you have your own PublicKey created with sn.exe)
just in front of your class you wish toprotected.
using System.Security.Permissions;
[StrongNameIdentityPermission(SecurityAction.Inheri tanceDemand,PublicKey="00
24000004....1")]
[StrongNameIdentityPermission(SecurityAction.LinkDe mand,PublicKey="="0024000
004....1")]
public class MyClass : {
....
}
Note: In order to use this, then your program that uses these must be strong
name checked and have this public/private key compiled into it.
Note: Do not use SecurityAction.LinkDemand, for visual controls ontherwise
the Visual studio cannot open it and gives an error.