csc.exe reference external .dll file

So, my question is what is the correct way to reference .dll file in csc when files are in an external folder.

You’re already referencing them at build time. You just need to make them available at execution time too, but copying them into the same directory as the executable, when you want to run it.

You could also investigate using the Global Assembly Cache if these are signed assemblies, but personally I’d stick with just keeping the executable with the libraries on which it depends.

Leave a Comment