In team development, if an assembly is to invoke another assembly, but the assembly to be called does not want to expose its own class with public,
So what to do, is to use the last kind of internal to do the visibility of the class.
Here's a simple example:
1. Create two class library projects A and B in one solution, and create classes ClassA and CLASSB in two class library projects, respectively
2. Set the access level of CLASSB in Project B to internal
3. Add a reference to Project B in Project A
4. CLASSB is not accessible in ClassA at this time, and if you want ClassA to have access to CLASSB, you must add the assembly for project A as a friend assembly for the project B assembly. Add friend assembly We want to use the Internalisvisibleto attribute, which requires adding a namespace
Using System.Runtime.CompilerServices.
5. Use the Internalisvisibleto attribute in the ClassB class to add assembly TA as a friend assembly.
6. The Internalisvisibleto feature can also be added to the AssemblyInfo.cs.
7. The CLASSB of Project B can now be accessed in ClassA, Project A.
C # Friend Assembly