
What is Internal Access Modifier in C# (C Sharp)?If you want
a type or a member of a type to be visible only within an assembly then
you will define it with internal access modifier. Create
the following class: Name
the class as sampleAssembly.cs and Compile this class by specifying /target:library Create
a new program called testClass.cs with the following code: public class
testClass { Compile
this program by specifying /reference:sampleAssembly.dll This is because,
you try to access internal member of sampleClass from a class which is
referencing the assembly but not belonging to that assembly. If the testClass
is also part of sampleAssembly then you can very well access sampleClass.member1
without any errors.
_______________________________________________________________________
FREE
Subscription
Subscribe
to our mailing list and receive new articles Note
: We never rent, trade, or sell my email lists to Visit
.NET Programming Tutorial Homepage ______________________________________________________ |