<p>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?</p>

[{'answer_id': 39129, 'author': 'Glenn Slaven', 'author_id': 2975, 'author_profile': 'https://Stackoverflow.com/users/2975', 'pm_score': 1, 'selected': False, 'text': '<p>Forgive 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.</p>\n\n<p>In any case if you mark everything <a href="http://msdn.microsoft.com/en-us/library/7c5ka91b.aspx" rel="nofollow noreferrer"><code>internal</code></a> it won\'t be able to be accessed outside its own library</p>\n'}, {'answer_id': 39132, 'author': 'Jon Limjap', 'author_id': 372, 'author_profile': 'https://Stackoverflow.com/users/372', 'pm_score': 1, 'selected': False, 'text': '<p>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</p>\n'}, {'answer_id': 39133, 'author': 'aku', 'author_id': 1196, 'author_profile': 'https://Stackoverflow.com/users/1196', 'pm_score': 3, 'selected': False, 'text': '<p>I think you can\'t forbid other applications to reference you library.<br>\nYou can make library\'s classes internal and provide access to them via <a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute.aspx" rel="nofollow noreferrer">InternalVisibleTo</a> attribute but it won\'t save you from reflection.</p>\n'}, {'answer_id': 39149, 'author': 'Glenn Slaven', 'author_id': 2975, 'author_profile': 'https://Stackoverflow.com/users/2975', 'pm_score': 2, 'selected': False, 'text': '<p>Yep, aku is right.  In reality if you want certain types &amp; methods to only be accessible to one application, you\'re better off compiling it all into one exe &amp; marking those types all internal.  You can then obfuscate the code to avoid the issue with reflection (see <a href="https://stackoverflow.com/questions/2525/best-net-obfuscation-toolsstrategy">here</a>)</p>\n'}]
['https://Stackoverflow.com/questions/39125', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/254/']