In this post, I’m going to explain to you how to make the internal components of a DotNet assembly visible to another one.
- There are two different approaches to solve this. They’re the same, the only difference is where you will write the statement.
- You must have access to the project file that contains the internal components.
- You can’t make visible internals in an already compiled assembly.
- Furthermore, you must know the assembly name of the project that will use the internals.
If you have the file «YourProject/Properties/AssemblyInfo.cs» available in your project, then you can add the next statement.
In SDK project files, you should add this statement in your project file. The compiler will add the InternalVisibleTo attribute when your solution is being built.