2018-11-07 06:14:54 +00:00
|
|
|
# csc
|
|
|
|
|
|
|
|
> The Microsoft C# Compiler.
|
2022-10-04 16:06:23 +01:00
|
|
|
> More information: <https://learn.microsoft.com/dotnet/csharp/language-reference/compiler-options/command-line-building-with-csc-exe>.
|
2018-11-07 06:14:54 +00:00
|
|
|
|
|
|
|
- Compile one or more C# files to a CIL executable:
|
|
|
|
|
|
|
|
`csc {{path/to/input_file_a.cs}} {{path/to/input_file_b.cs}}`
|
|
|
|
|
|
|
|
- Specify the output filename:
|
|
|
|
|
|
|
|
`csc /out:{{path/to/filename}} {{path/to/input_file.cs}}`
|
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Compile into a `.dll` library instead of an executable:
|
2018-11-07 06:14:54 +00:00
|
|
|
|
|
|
|
`csc /target:library {{path/to/input_file.cs}}`
|
|
|
|
|
|
|
|
- Reference another assembly:
|
|
|
|
|
|
|
|
`csc /reference:{{path/to/library.dll}} {{path/to/input_file.cs}}`
|
|
|
|
|
|
|
|
- Embed a resource:
|
|
|
|
|
2019-04-23 14:04:25 +01:00
|
|
|
`csc /resource:{{path/to/resource_file}} {{path/to/input_file.cs}}`
|
2018-11-07 06:14:54 +00:00
|
|
|
|
|
|
|
- Automatically generate XML documentation:
|
|
|
|
|
|
|
|
`csc /doc:{{path/to/output.xml}} {{path/to/input_file.cs}}`
|
|
|
|
|
|
|
|
- Specify an icon:
|
|
|
|
|
|
|
|
`csc /win32icon:{{path/to/icon.ico}} {{path/to/input_file.cs}}`
|
|
|
|
|
|
|
|
- Strongly-name the resulting assembly with a keyfile:
|
|
|
|
|
|
|
|
`csc /keyfile:{{path/to/keyfile}} {{path/to/input_file.cs}}`
|