In compiled system languages (like C/C++), generally, the entry point is resolved at link time, which gives the ability to have the main
function in a DLL so the linker won't complain and set the entry point address to the symbol in the DLL (or the function in the import library, not sure about that).
I recently started using C# and I would like to do something similar, where I have the Main
method in a library (which preferably build against .NET Standard) and the actual exe don't define any entry point and uses the one in the library.
I get that I could just write a Main
method in the exe and call the Main
of the library in it, but the point is that I would like to avoid that.
I believe Winforms and WPF provide something similar, so hopefully what I'm trying to do is possible, otherwise, please educate me on the reasons why .NET doesn't provide such mechanism.