csc looks for DLLs in the current directory in the framework directory in the directories mentioned in the / lib directory in the directories mentioned in the LIB environment variable.
But not in the GAC. You can compile with csc / r: full_path_to_the_gac_file.dll, it works, but is not very user friendly.
.NET assemblies are installed in two places: in the GAC and in the framework directory (which explains why they are found).
Copy the necessary DLL files to the specified directory and specify it using the / lib switch. Of course, at runtime it will be taken from the PAC.
source share