如何防止我的.Net DLL被添加为参考? [英] How do I prevent my .Net dll from being added as a reference?

查看:112
本文介绍了如何防止我的.Net DLL被添加为参考?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我写了一个.Net DLL,并希望用我的应用程序分发它。我如何防止任何有精明的用户安装VS的副本,以将这个dll的引用添加到自己的应用程序中?

解决方案

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆