A C# program uses .Net framework libraries or third party libraries by using
directive in the C# code.
When compiling the program using csc
,
how shall we specify the search path for the used libraries?
does the compiler search for the used libraries in some search order?
I am comparing csc
to gcc
and javac
in terms of specifying search paths for libraries and searching order. For gcc
and javac
, there are multiple ways to specify search paths,
- command line options to them, such as
-L
togcc
and-classpath
tojavac
; - environment variables, such as
LIBRARY_PATH
forgcc
andCLASSPATH
forjavac
; - default paths, such as current directory, some system-wide directory
Does csc
also have multiple ways, and have a search order between them?
Same questions if compiling the program using msbuild
which calls csc
.
Thanks.