I am currently working on a .net project which I am dividing into different assemblies.
One assembly (a dll) will contain most of the domain logic, and the other assemblies (.exe) will contain most of the presentation and control logic.
My question is, if I want to prevent someone from getting my DLL, and adding it as a reference on Visual Studio and develop a new interface for the model without my permission, can I do this with just building the assemblies as private? Does building the assemblies as private means that only the assemblies that were built together can be referenced by each other?
What is the easiest way to build an application and have its DLLs and EXEs function as a single logical unit on which a DLL assembly can only be referenced by the referencing assemblies when the project was built.
Regards,
The
InternalsVisibleToAttributecan be of help. Just slap it onto the .dll using the .exe assembly full name and make everything in the .dllinternal:If you use strong names that would be even safer, because otherwise I could just create an .exe with the same file name as yours.
There is also an MSDN page about Friend Assemblies.