-refonly (Visual Basic)
The -refonly option indicates that the primary output of the compilation should be a reference assembly instead of an implementation assembly. The -refonly
parameter silently disables outputting PDBs, as reference assemblies cannot be executed.
Every compiler option is available in two forms: -option
and /option
. The documentation only shows the -option
form.
Syntax
-refonly
Remarks
Visual Basic supports the -refonly
switch starting with version 15.3.
Reference assemblies are a special type of assembly that contain only the minimum amount of metadata required to represent the library's public API surface. They include declarations for all members that are significant when referencing an assembly in build tools, but exclude all member implementations and declarations of private members that have no observable impact on their API contract. For more information, see Reference assemblies in .NET Guide.
The -refonly
and -refout
options are mutually exclusive.