Currently SDK targets try to preserve all references in the deps file as follows:
package with package metadata for package resolver. Loaded from packages, or refs folder on publish.referenceassembly with reference assembly subpath. Loaded from program files, or refs folder on publish.reference and copied to bin. Loaded from bin.To repro use the following project:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net461</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
</PropertyGroup>
<ItemGroup>
<Reference Include="..\lib\bin\Debug\netstandard2.0\lib.dll">
<Private>false</Private>
</Reference>
</ItemGroup>
</Project>
Where the path to lib.dll is some binary on the machine. Note that lib is missing from the deps file.
This is specifically breaking NETStandard.Library.NETFramework (which uses Private=false refs from targets) but is generally a problem for any non-copy-local refs that don't come from a targeting pack or nuget package. Other examples of this are AssemblyFoldersEx where a filelist is used to make the reference Private=false, references explicitly marked as Private=false, etc.
@eerhardt and I discussed this and believe that the deps file generation should identify any references which weren't otherwise included and include those as reference type and copy the reference assembly to a refs folder on build.
I'm working on this fix today.
Any status update on this guy?
Any status update on this guy?
I had a fix over the weekend. I spent some time today coming up with a decent test.
PR is out: https://github.com/dotnet/sdk/pull/1272
Fixed by #1272
Most helpful comment
I'm working on this fix today.