Expose internal types and members to another assemblies

In Some scenarios we might want to access some of the internally protected item to outside the assembly. By using the attribute [assembly: InternalsVisibleTo(“AssemblyName”)] in the assemblyInfo class you can access
the all the members and internal types to another assemblies.
For example if i want to access the below internal class and method in to another assembly
namespace InternalThings
{
internal class InternalClass
{
internal void InternalMethod()
{
}
}
}

for example DemoInternal, Just a add an attribute to assemblyInfo class
[assembly: InternalsVisibleTo(“DemoInternal”)] in the InternalThings Assembly ie, Our Internal members existing project or assembly.

Enjoy Coding…

One thought on “Expose internal types and members to another assemblies

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s