This change request came from an external connect bug. Note the change is only when the Private tag ('Copy Local' in Visual Studio) is not present, which is the default. If this flag is given by the user it will still be honored in all cases.
Current Resolve Assembly Reference (RAR) behavior
- If the assembly is resolved and not found in the GAC, copy it.
- If the assembly is resolved from the GAC, don't copy the DLL.
- If the assembly is resolved locally and also happens to be present in the GAC, don't copy the DLL.
This behavior was intended to somewhat mimic run-time behavior. If an assembly is in the GAC on the build machine, it's assumed to be in the GAC on the target machine.
Proposed change in behavior
- If the assembly is resolved locally (not in the GAC) copy it. Regardless of if it's in the GAC or not.
- If the assembly is resolved through the GAC (wasn't found locally), then do not copy it.
Repro Steps
- Project1 references Project2 (Project Reference type)
- Project2 not in the GAC.
- Build
This yields the desired behavior, Project2.dll appears in the output folder.
However, if this test is repeated with Project2 in the GAC, Project2.dll will not be copied. The proposed fix would change this behavior and copy Project2.dll (since it was resolved locally first). This should also help when NuGet packages are referenced but also in the GAC on the build machine.
This change request came from an external connect bug. Note the change is only when the Private tag ('Copy Local' in Visual Studio) is not present, which is the default. If this flag is given by the user it will still be honored in all cases.
Current Resolve Assembly Reference (RAR) behavior
Proposed change in behavior
Repro Steps
This yields the desired behavior, Project2.dll appears in the output folder.
However, if this test is repeated with Project2 in the GAC, Project2.dll will not be copied. The proposed fix would change this behavior and copy Project2.dll (since it was resolved locally first). This should also help when NuGet packages are referenced but also in the GAC on the build machine.