Make your internal classes visible to certain assemblies!

I tried to add some unit tests today and found that I want to test classes in another assembly that are internal, thus not visible outside of that assembly. So I hit Google for an answer. What I found was InternalsVisibleTo assembly attribute. By marking assembly with this attribute like this:

[assembly: InternalsVisibleTo("Test.Library.Name")]

we make internal classes visible to Test.Library.Name assembly! It also works with signed assemblies.


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s