Search code examples
c#encapsulation

What does assembly include when using internal as access modifier?


Internal types or members are accessible only within files in the same assembly,

I'm afraid that I don't know exactly what does assembly mean in C#.

Could you please explain it's definition when defining member as internal?


Solution

  • Each project (.csproj file) in a solution (.sln file) will produce an assembly. (each .exe file or .dll file is considered an assembly)

    When a member is internal it is seen as public to all other classes in the same project but it is seen as private to all classes outside of the project.