Friend Assemblies

by Juan 27. June 2008 17:08
Share on Facebook

Today I was designing some unit tests for a project here at work, and needed to access some helper methods (mostly constants) to check the output of a few methods, and was happy to discover this attribute.

With InternalsVisibleTo you can specify which assembly, if any, other than the current one, can "see" information marked as internal.

As I said, it's very useful when designing tests, or for example if you want some component to be accessed only by another (the same use you give to internal, but expanding across several assemblies)

You can use it at assembly level like this

[assembly: InternalsVisibleTo("JMF.Tests")]

Where JMF.Tests is the Assembly Friendly Name

Tags: , , ,

Programming | Tips

Comments

Powered by BlogEngine.NET 1.4.5.15
Theme by Mads Kristensen Modified by Juan Manuel Formoso

About the Author

Juan Manuel
Networking
View my LinkedIn profile View my Facebook profile View my Twitter feed View my StackOverflow CV

Juan Manuel Formoso
There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something more bizarrely inexplicable.

There is another theory which states that this has already happened.

E-mail me Send mail

Hosting is not Free

Google Reader Picks

Most comments

Cristian Cristian
1 comments
co Colombia

Calendar

<<  July 2010  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

Recent comments

Comment RSS

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in  anyway.

© Copyright 2008