Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

/target:library (Create a Code Library)

/target:library

Remarks

The /target:library option causes the compiler to create a dynamic-link library (DLL) rather than an executable file (EXE). The DLL will be created with the .dll extension.

Unless otherwise specified with the /out option, the output file name takes the name of the first input file.

When specified at the command line, all files up to the next /out, /target:winexe, or /target:exe option are used to create the .dll file.

When building a .dll file, a Main method is not required.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C# Project Properties.
  2. Click the Common Properties folder.
  3. Click the General property page.
  4. Modify the Output Type property.

To set this compiler option programmatically

See OutputType Property.

Example

Compile in.cs, creating in.dll:

csc /target:library in.cs

See Also

/target (Specify Output File Format) | C# Compiler Options

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.