In msvc i can write
#pragma comment(lib, "my.lib");
which includes my.lib in the linking stage. In my solution i have 2 projects. One is a class project the other is my main. How do i include the reference dll in code instead of adding the reference in the project?
I’m afraid you can’t.
You can dynamically load the assembly via
Assembly.Load(...)but then you have use reflection to explicitly create each Type you need to use.