How can a .net class library project and resulting dll be protected so it cant be referenced by other applications (.net projects) except those projects in my own solution?
views:
174answers:
4Forgive my ignorance, but if they're all class libraries, what does the code do? Isn't the purpose of having a dll so that the code can be referenced.
In any case if you mark everything internal
it won't be able to be accessed outside its own library
I think what deanbates is saying is that he is trying to find a way to keep a DLL public within his own application and private for everything else
I think you can't forbid other applications to reference you library.
You can make library's classes internal and provide access to them via InternalVisibleTo attribute but it won't save you from reflection.
Yep, aku is right. In reality if you want certain types & methods to only be accessible to one application, you're better off compiling it all into one exe & marking those types all internal. You can then obfuscate the code to avoid the issue with reflection (see here)