StrongNameIdentityPermission not working in 2005

  • Thread starter Thread starter archana
  • Start date Start date
A

archana

Hi all,

I am having application in 2003 where i have one class library and two
console application.

In class library i have one class to which i set
strongnameidentitypermission. When i try to use this class in first
console application which is having same publickkey as i set in
strongnameidentiypermission it works. and for second console
application having different public key it gives me error.

but when i try to do same thing in 2005 , even if console application
is having different public key still the method which i defined in
class library is getting accessing and working properly.

I am not getting what is happening. even after setting strong name all
other assembly are getting access to this class which i don;t want to
expose to other.

Please tell me why this is happening.

thanks in advance.
 
archana said:
I am having application in 2003 where i have one class library and two
console application.

In class library i have one class to which i set
strongnameidentitypermission. When i try to use this class in first
console application which is having same publickkey as i set in
strongnameidentiypermission it works. and for second console
application having different public key it gives me error.

but when i try to do same thing in 2005 , even if console application
is having different public key still the method which i defined in
class library is getting accessing and working properly.

I am not getting what is happening. even after setting strong name all
other assembly are getting access to this class which i don;t want to
expose to other.

Please tell me why this is happening.


Contrary to the Framework Version 1 (VS 2003), in the Framework version
2.0 (VS 2005) the StrongNameIdentityPermission is granted by default to all
assemblies that run with Ful Trust, regardless of their strong name. Since
you are probably executing your console application from an executable file
located in the local machine, it defaults to running with full trust and is
therefore able to bypass the permission request.

Notice that, even in the Framework 1, an assembly with Full Trust would
be able to use Reflection to bypass a StrongNameIdentityPermission, so this
permission demand wouldn't be a secure way to prevent access to your
assembly even when using VS 2003.
 

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