Export (0) Print
Expand All
Expand Minimize

ResolveAssemblyReference.CopyLocalDependenciesWhenParentReferenceInGac Property

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Gets or sets a switch that determines how dependencies are determined, and whether or not a dependency is copied locally.

Namespace:  Microsoft.Build.Tasks
Assembly:  Microsoft.Build.Tasks.v4.0 (in Microsoft.Build.Tasks.v4.0.dll)

public bool CopyLocalDependenciesWhenParentReferenceInGac { get; set; }

Property Value

Type: System.Boolean
Returns true if when determining if a dependency should be copied locally one of the checks done is to see if the parent reference in the project file has the Private metadata set or not. If that metadata is set then we will use that for the dependency as well.
If the metadata is not set then the dependency will go through the same checks as the parent reference. One of these checks is to see if the reference is in the GAC. If a reference is in the GAC then we will not copy it locally as it is assumed it will be in the gac on the target machine as well. However this only applies to that specific reference and not its dependencies.
This means a reference in the project file may be copy local false due to it being in the GAC but the dependencies may still be copied locally because they are not in the GAC. This is the default behavior for RAR and causes the default value for this property to be true.
Returns false if we will still check project file references to see if they are in the GAC and set their copy local state as appropriate.
However for dependencies we will not only check to see if they are in the GAC but we will also check to see if the parent reference from the project file is in the GAC.
If the parent reference from the project file is in the GAC then we will not copy the dependency locally.
NoteNote

If there are multiple parent reference and ANY of them does not come from the GAC then we will set copy local to true.

.NET Framework

Supported in: 4.6, 4.5, 4
Show:
© 2015 Microsoft