Restricting code access

  • Thread starter Thread starter RA
  • Start date Start date
R

RA

How can I have a resticted access to assembly? I want onlt code I am writing
to be able to access my assemblys.

Thanks,
Ron
 
Hi,

One solution may to create a strong name for your
assemblies.
And inside your code do the following,

1) create the permissionset object.
2) create the StrongNameIdentityPermission with the
public key you have used in your assemblies.
3) Add the StrongNameIdentityPermission to the
permissionset object.
4) Call the Demand method, thus insuring all the callers
have the same strong name which essentially means all
your assemblies.

Also, you can look at the security tutorial which should
give you a jump start on Code Access Security..

http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/csref/html/vcwlksecuritytutorial.asp

Hope this helps...

Regards,
Madhu

MVP | MCSD.NET
 

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

Back
Top