Reference3::CopyLocal Property
Gets or sets whether the reference is copied to the local bin path.
Assembly: VSLangProj80 (in VSLangProj80.dll)
Implements
Reference2::CopyLocalAt run time, a reference must exist in either the global assembly cache 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.
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 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 is automatically updated by the project system if needed.
The project-assigned value of the CopyLocal property is determined in the following order:
If the reference is another project, called a project-to-project reference, then the value is true.
If the reference is a Visual Studio .NET Framework assembly, then the value is false.
If the reference's assembly matches a Visual Studio .NET Framework assembly’s strong name except for version number (such as Visual Studio 2003 assemblies, for example), then the value is false.
If the reference's assembly is in the .NET Framework directory, then the value is false.
If the reference's assembly is in the GAC, then the value is false.
Otherwise, the value is true.
Note that number 4 above is not the same as number 3 because the .NET Framework SDK folder is not the same thing as the .NET Framework directory.
This example displays the CopyLocal values for all references in an open Visual Basic or Visual C# project. To run this example as an add-in, see How to: Compile and Run the Automation Object Model Code Examples.