I have the following situation:
Assembly A.dll have some routine inside that application B.exe uses. I waht
to prevent other people from loading A.dll and call the method with the
For that, I make A.dll and B.dll strong named, and the method
"String SensitiveRoutine()" have the StrongNameIdentityPermission attribute
with the pulic key of B.exe, I set the security action to Demand.
and I receive this secutiry error:
Request for the permission of type
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
If I set the security action to LinkDemand I don't receive the error, but
other application C.exe with different public key can call the method! and I
don't want this.
If I put the attribute at assembly level
[assembly:StrongNameIdentityPermissionAttribute........] with RequestMinimum
as security action, it does't work.
what should I do to ensure that the code that call the sensitive routine is
one from the strong named assemblies that I signed before?