tags:

views:

78

answers:

3

Is possible to restrict access to my .NET DLL library? My application has more EXE assemblies and I need share some code, but I don't want someone else could use that.

+1  A: 

You could make all your APIs internal and expose the other assembly as a friend. This is by no means copy protection though, someone can still dissassemble your assembly.

Bob
+3  A: 

It depends on how much you care. A simple way is to make everything internal and then use friend assemblies to allow your assembly to call it.

http://msdn.microsoft.com/en-us/library/0tke9fxk.aspx

Most things you would do can be defeated, but if someone wants to call, they will figure out a way to do it.

Lou Franco
+1  A: 

you can sign your code, and check the signature in the dll I guess. you can use a secret (that can easily engineered from disassemblly of your dll) between the exe and the dll

Dani