Bagikan melalui


/vbruntime

Specifies that the compiler should compile without a reference to the Visual Basic Runtime Library, or with a reference to a specific runtime library.

/vbruntime:{ - | + | path }

Arguments

  • -
    Compile without a reference to the Visual Basic Runtime Library.

  • +
    Compile with a reference to the default Visual Basic Runtime Library.

  • path
    Compile with a reference to the specified library (DLL).

Remarks

The /vbruntime compiler option enables you to specify that the compiler should compile without a reference to the Visual Basic Runtime Library. You can also use the /vbruntime compiler option to compile with a reference to a custom runtime library instead of the default Visual Basic Runtime Library. If you compile without a reference to the Visual Basic Runtime Library, errors or warnings are logged on code or language constructs that generate a call to a Visual Basic runtime helper. (A Visual Basic runtime helper is a function defined in Microsoft.VisualBasic.dll that is called at runtime to execute a specific language semantic.)

The /vbruntime+ option produces the same behavior that occurs if no /vbruntime switch is specified. You can use the /vbruntime+ option to override previous /vbruntime switches.

If the value for the path argument is a fully qualified path to a DLL, the compiler will use that file as the runtime library. If the value for the path argument is not a fully qualified path to a DLL, the Visual Basic compiler will search for the identified DLL in the current folder first. It will then search in the path that you have specified by using the /sdkpath compiler option. If the /sdkpath compiler option is not used, the compiler will search for the identified DLL in the .NET Framework folder (%systemroot%\Microsoft.NET\Framework\versionNumber).

Example

The following example shows how to use the /vbruntime option to compile with a reference to a custom library.

vbc /vbruntime:C:\VBLibraries\CustomVBLibrary.dll

See Also

Reference

Sample Compilation Command Lines

/sdkpath

Other Resources

Visual Basic Compiler