/addmodule:file[;file2]
where:
The /addmodule option causes the compiler to make all type information from file available to the project you are currently compiling.
file cannot contain an assembly manifest. For example, if the output file was created with /target:module, its metadata can be imported with /addmodule.
If you (implicitly or explicitly) specify any /target option other than /target:module with /addmodule, the files that you pass to /addmodule will become part of the project's assembly. An assembly is required to run an output file that has one or more files added with /addmodule.
Use /reference to import metadata from an output file that does contain an assembly manifest.
Compile source file input.cs
and add metadata from metad1.dll
and metad2.dll
to produce out.exe
:
csc /addmodule:metad1.dll;metad2.dll /out:out.exe input.cs