如何防止我的.Net DLL被添加为参考? [英] How do I prevent my .Net dll from being added as a reference?
问题描述
p>没有办法阻止用户添加引用。这是DLL的一部分被动的行为,没有什么可以做,以防止它发生。
你可以做什么,是添加一个引用非常值得运营。例如,如果DLL中的所有类型都是内部或私有的,那么它不仅仅是为用户添加引用以使用DLL中的类型。此外,混淆DLL将使其更加困难。
Say I've written a .Net dll and want to distribute it with my application. How can I prevent any user with the savvy to install a copy of VS from adding a reference to this dll to their own applications?
There is no way to prevent a user from adding a reference. It's a passive action from the part of your DLL and there is nothing you can do to prevent it from occuring.
What you can do though, is make adding a reference a non-worthwhile operation. For instance, if all types in the DLL were internal or private, it take more than simply adding a reference for users to use the types in the DLL. Furthmore, obfuscating the DLL would make it even harder.
这篇关于如何防止我的.Net DLL被添加为参考?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!