Visual Basic Compiler Options  

/target

Specifies the format of compiler output.

/target:[exe | library | module | winexe]

Remarks

Use /target:exe to create a .exe console application. This is the default if you do not specify the /target option.

Use /target:library to create a dynamic-link library (DLL).

Use /target:module to create a module.

Use /target:winexe to create a Windows program.

Unless you specify /target:module, /target causes a .NET Framework assembly manifest to be placed in an output file.

Each invocation of vbc.exe produces, at most, one output file. If you specify a compiler option such as /out or /target more than once, the last one the compiler sees is put into effect. Information about all files in a compilation is placed in the manifest. All output files except those created with /target:module contain assembly metadata in the manifest. Use MSIL Disassembler (Ildasm.exe) to view the metadata in an output file.

Example

If you create an assembly, you can indicate that all or part of your code is CLS-compliant with the CLSCompliantAttribute Class attribute, as in the following code:

<Assembly: System.CLSCompliant(True)> 
<System.CLSCompliant(False)> _
Public Class AClass
End Class

Module Module1
   Sub Main()
   End Sub
End Module

See Also

Visual Basic Compiler Options | Assemblies | Sample Compilation Command Lines