<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="https://stackoverflow.com/questions/203616/why-does-c-sharp-not-provide-the-c-style-friend-keyword">Why does C# not provide the C++ style ‘friend’ keyword?</a>  </p>
</blockquote>



<p>I'd like the private member variables of a class to be accessible to a Tester class without exposing them to other classes. </p>

<p>In C++ I'd just declare the Tester class as a friend, how do I do this in C#? Can someone give me an example?</p>

There's no direct equivalent of "friend" - the closest that's available (and it isn't very close) is
InternalsVisibleTo
. I've only ever used this attribute for testing - where it's very handy!
Example:
To be placed in
```
AssemblyInfo.cs
```
```
```
[assembly: InternalsVisibleTo("OtherAssembly")]
```
```