Hi Tim,
Thanks for your post!!
Based on my understanding, you want to export several public methods from a
DLL assembly, then limit the assembly that can call these methods. If I
misunderstand you, please feel free to tell me, thanks
First, in software area, protection and crack are against with each other
for a long time, there is no complete way of preventing the software from
being cracked. This is also true for .Net. Also, because of the .Net
assembly metadata and manifest, it is even much easier for hack to do
reverse engineering with the .Net assembly. I think Reflector is a good
point for this.
Ok, let's back to our topic. For your request, I think the first step we
should do is strong name our calling exe assembly, that is because only
strong named assembly can be only identified easily, it is like that
assembly has an identity.
Then, in our dll methods, we can use Assembly.GetCallingAssembly method to
get the assembly reference that is calling our methods. With the assembly
reference, we may use Assembly.GetName().GetPublicKey() to get the strong
name pulic key of the calling assembly. Then we can do the comparison and
fail the unexpected assembly calling.
I think the article below may give you some hint:
http://blogs.msdn.com/shawnfa/archiv...26/248114.aspx
There maybe some other good ways to get this done. And other community
members may give some good advise. Thanks
================================================== ==========
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.