Visual Basic Compiler Options  

/libpath

/libpath:dir1[,dir2]

Arguments

dir1
A directory for the compiler to look in if a referenced assembly is not found in either the current working directory (the directory from which you are invoking the compiler) or the common language runtime's system directory.
dir2
Additional directories to search for assembly references. Separate additional directory names with a comma.

Remarks

The /libpath option specifies the location of assemblies referenced via the /reference option.

The compiler searches for assembly references that are not fully qualified in the following order:

  1. Current working directory. This is the directory from which the compiler is invoked.
  2. The common language runtime system directory.
  3. Directories specified by /libpath.
  4. Directories specified by the LIB environment variable.

/libpath is additive; specifying it more than once appends to any prior values.

Use /reference to specify an assembly reference.

To set /libpath in the Visual Studio integrated development environment

  1. Open the project's Property Pages dialog box. For details, see <Projectname> Property Pages Dialog Box.
  2. Click the Common Properties folder.
  3. Click the Reference Path property page.
  4. Modify the Folder property.

To set /libpath programmatically

Example

The following code compiles t2.vb to create a .exe file. The compiler looks in the working directory and in the root directory of the C drive for assembly references:

vbc /libpath:c:\ /reference:t2.dll t2.vb

See Also

Assemblies | Visual Basic Compiler Options | Sample Compilation Command Lines