Click here to Skip to main content
13,596,975 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


5 bookmarked
Posted 25 Jan 2011
Licenced CPOL

Exposing internal members to other projects

, 26 Jan 2011
Rate this:
Please Sign up or sign in to vote.
Exposing internal members to other projects
Sometimes, it is needed to expose some attribute of a class that is internal or sometimes it is needed to expose an internal class. Basically, it is needed to carry out Unit testing as generally we have unit test code residing in another project.

We can expose an internal class or any internal attribute of a class by using the following attribute:
[assembly: InternalsVisibleTo("AssemblyNameOfTheProjectToWhichTheInternalOfThisClassWillBeVisible, PublicKey= 0000public key of assembly(optional)000")]
public class MyInternalWillBeExposedToSpecificOutsideProject
    internal void SomeMethod()


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Mahmudul Haque Azad
Software Developer (Senior) Vizrt Bangladesh
Bangladesh Bangladesh
I am truly versatile and 360 degree Engineer having wide range of development experience in .NET and Java Platform. I am also proficient in system level programming in C++. To me technology is not at all a problem, it’s the client requirement that matters! That is I am ready and comfortable to use any technology to make the business of my client a success.

In my five years of experience I have the opportunities to work for fortune 500 companies of US and many renowned clients from Europe.

My Linkedin Profile:

You may also be interested in...


Comments and Discussions

GeneralReason for my vote of 5 New to me Pin
thatraja5-Mar-11 4:28
mvpthatraja5-Mar-11 4:28 
GeneralPerhaps you should rethink your testing strategy. The point ... Pin
Kirk Wood31-Jan-11 15:14
memberKirk Wood31-Jan-11 15:14 
GeneralYou should add this attribute in AssemblyInfo.cs as its scop... Pin
xlg31-Jan-11 6:00
memberxlg31-Jan-11 6:00 
GeneralReason for my vote of 5 This is new to me. And sounds intere... Pin
Venkatesh Mookkan26-Jan-11 3:55
memberVenkatesh Mookkan26-Jan-11 3:55 
GeneralReason for my vote of 5 yep, pretty useful for testing Pin
jim lahey26-Jan-11 1:56
memberjim lahey26-Jan-11 1:56 
GeneralNice. Like friend in C++, but more powerful. :) Pin
Indivara25-Jan-11 23:59
subeditorIndivara25-Jan-11 23:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.180621.3 | Last Updated 26 Jan 2011
Article Copyright 2011 by Mahmudul Haque Azad
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid