Поделиться через


Reference.CopyLocal Property

Determines whether the reference is copied to the local bin path.

Namespace:  VSLangProj
Assembly:  VSLangProj (in VSLangProj.dll)

Syntax

'Declaration
Property CopyLocal As Boolean
    Get
    Set
bool CopyLocal { get; set; }
property bool CopyLocal {
    bool get ();
    void set (bool value);
}
abstract CopyLocal : bool with get, set
function get CopyLocal () : boolean
function set CopyLocal (value : boolean)

Property Value

Type: System.Boolean
Boolean.

Remarks

At run time, assemblies must be in one of two locations: the output path of the project or the global assembly cache (see Working with Assemblies and the Global Assembly Cache). If the project contains a reference to an object that is not in one of these locations, then when the project is built, the reference must be copied to the output path of the project. The CopyLocal property indicates whether this copy needs to be made. If the value is true, the reference is copied to the output path of the project at run time. If false, the reference is not copied.

The common language runtime does not track the changes to the reference to determine if the local copy needs to be updated. Changes are tracked by the project system. As long as the user has not overridden the CopyLocal property, the value will be automatically updated by the project system if needed.

The project-assigned value of CopyLocal is determined in the following order:

  1. If the reference is another project, called a project-to-project reference, then the value is true.

  2. If the assembly is found in the global assembly cache, the value is false.

  3. As a special case, the value for the mscorlib.dll reference is false.

  4. If the assembly is found in the Framework SDK folder, then the value is false.

  5. Otherwise, the value is true.

Examples

See the example in Reference.

.NET Framework Security

See Also

Reference

Reference Interface

VSLangProj Namespace