VaclavD
VaclavD

Reputation: 2622

How to restrict access to my DLL

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.

Upvotes: 1

Views: 828

Answers (3)

Dani
Dani

Reputation: 15069

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

Upvotes: 1

Lou Franco
Lou Franco

Reputation: 89172

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.

Upvotes: 3

Bob
Bob

Reputation: 99724

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.

Upvotes: 1

Related Questions