I already know that C# provides internal
modifier:
internal: The type or member can be accessed by any code in the same assembly, but not from another assembly. --- Quoted from this official document
And I also understand what is an assembly. It is basically a DLL or EXE.
Now, how can we be sure all our internal things will actually be compiled into the same assembly? The reason I ask this, is because I got an impression from here that the build process can be very flexible, different source file can potentially be compiled into different assemblies:
csc /target:library /out:MathLibraryPart1.DLL Add.cs
csc /target:library /out:MathLibraryPart2.DLL Mult.cs
to a point that we would even need a way to detect whether a file is in a particular assembly.
Put it in another way, if I already wrote my library with internal
modifier here and there and then commit my code, but then the eventual binary output may or may not work as intended, due to the different way to build my source code. That doesn't sound right to me. Unless, the way to build my source code is (forced to become) also an integral part of my project and need to be checked into my code repo. Is that the case?