Partilhar via


ResolveAssemblyReference.CopyLocalDependenciesWhenParentReferenceInGac Property

Definition

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.

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

When this property is false 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.

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

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

public:
 property bool CopyLocalDependenciesWhenParentReferenceInGac { bool get(); void set(bool value); };
public bool CopyLocalDependenciesWhenParentReferenceInGac { get; set; }
public bool CopyLocalDependenciesWhenParentReferenceInGac { [System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] get; [System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] set; }
member this.CopyLocalDependenciesWhenParentReferenceInGac : bool with get, set
[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
[<set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
member this.CopyLocalDependenciesWhenParentReferenceInGac : bool with get, set
Public Property CopyLocalDependenciesWhenParentReferenceInGac As Boolean

Property Value

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. If that metadata is set, 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.

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

Attributes

Applies to