Cook Computing

Friend Assemblies

November 6, 2003 Written by Charles Cook

Omer van Kloeten's blog has a post in which Jim Hogg, CLR PM at Microsoft, mentions in the comments a forthcoming feature, Friend Assemblies (via Brad Abrams):

So, we intend to introduce a new feature in next release of .NET -- "Friend Assemblies", that does precisely what you're suggesting. It will use an assembly-level custom attribute called "InternalsVisibleTo", that grants access to a named "friend" assembly (Omer.B in this example) -- for all "internal" types.

This sounds useful for cases where you don't want to package code in a single assembly yet still want to use "internal" visibility for your types and their members. The blog post and comments discuss some of the issues around this.

Update: John Lam describes how friend assemblies will be very useful for implementing unit tests.