dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.17k stars 1.34k forks source link

t:/Pack produces dependencies for content only packages #3044

Open dazinator opened 6 years ago

dazinator commented 6 years ago

Steps to reproduce

Pack this project file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard20</TargetFramework>
    <IncludeBuildOutput>false</IncludeBuildOutput>
  </PropertyGroup>

  <ItemGroup>
    <Content Include="foo.txt">     
    </Content>       
  </ItemGroup> 

</Project>

(You will need to create the foo.txt file in the project directory).

Directory contents:

/
- foo.txt

Command line

msbuild /t:pack 

Expected behavior

Nuget package does not have any dependencies.

Actual behavior

The nuspec file in the produced nuget package expresses the following dependency:

  <dependencies>
      <group targetFramework=".NETStandard2.0" />
    </dependencies>

Environment data

msbuild /version output: 15.5.180.51428

OS info: windows 10

avivanoff commented 3 years ago

Two years and still no resolution?