Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I prevent my .Net dll from being added as a reference?

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?

like image 985
Leonard H. Martin Avatar asked Dec 03 '22 15:12

Leonard H. Martin


1 Answers

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.

like image 61
JaredPar Avatar answered Dec 06 '22 11:12

JaredPar