Sdk: Deps file generation is missing references with Private=false

Created on 26 May 2017  路  4Comments  路  Source: dotnet/sdk

Currently SDK targets try to preserve all references in the deps file as follows:

  • Non-copy local assemblies (private=false)

    • NuGet packages preserved as package with package metadata for package resolver. Loaded from packages, or refs folder on publish.

    • Framwork reference assemblies preserved as referenceassembly with reference assembly subpath. Loaded from program files, or refs folder on publish.

    • Issue: Any other non-copy local assemblies are dropped.

  • Copy-local assemblies (private=true or undefined)

    • Project references preserved as 'projectreference` and copied to bin. Loaded from bin.

    • Binary references preserved as 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.

Blocking Partner Urgency-Soon

Most helpful comment

I'm working on this fix today.

All 4 comments

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

Was this page helpful?
0 / 5 - 0 ratings