Monday 18 July 2011

Dot.Net: Make Internal Methods and Properties visible to another DLL

Question:
How to make internals visible to another dll?
I want to render my internals visible to a test class. How do I do that?


Answer:
You can add an assembly attribute (InternalsVisibleTo) to the the AssemblyInfo.cs file

Here is the code
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("MyNamespace.TestClass")]


No comments: