C# assemblies, whats in an assembly?

后端 未结 5 1341
难免孤独
难免孤独 2020-12-28 14:00

I\'m trying to understand the internal access modifier in C#. I can\'t seem to understand what an assembly is exactly, and what part of my program is held inside that assemb

5条回答
  •  我在风中等你
    2020-12-28 14:31

    Basically, you cannot make a variable visible only from within a given namespace. As anybody can define any namespace, this would make the idea of internal void: you would just have to write

    namespace System
    {
        public static MySystemInternalSpy
        {
            public static void SpyInternals()
            {
                ...
            }
        }
    }
    

    to gain access to any variable, class or method defined as internal in the System namespace, for instance.

提交回复
热议问题