Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CopyLocal Property (Reference Object)

Visual Studio .NET 2003

Determines whether the reference is copied to the local bin path. At run time, a reference must exist in either the global cache assembly or the output path of the project. If this property is set to true, the reference is copied to the output path of the project at run time.

[Visual Basic .NET]
Public Property CopyLocal() As Boolean
[Visual Basic 6]
Property Get CopyLocal() As Boolean
Property Let CopyLocal( _
   ByVal NewValue As Boolean _
) 
[C++]
HRESULT __stdcall get_CopyLocal(
   /* [out, retval] */ VARIANT_BOOL* retVal
);
HRESULT __stdcall put_CopyLocal(
   /* [in] */ VARIANT_BOOL NewValue
);
[C#]
bool CopyLocal {get; set;}
[JScript .NET]
public function get CopyLocal() : Boolean
public function set CopyLocal(
   NewValue : Boolean
)

Parameters

NewValue
If true, the reference is copied to the project's output path. If false, the reference is not copied.

Return Value

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. 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.

Example

See the example in the Reference Object topic.

See Also

Applies To: Reference Object

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft