emgarten / Sleet

A static nuget feed generator for Azure Storage, AWS S3, and more.
MIT License
362 stars 43 forks source link

Cannot reference from regular build projects anymore #75

Closed kzu closed 5 years ago

kzu commented 5 years ago

Given the following build script project:

<Project Sdk="Microsoft.Build.NoTargets/1.0.53">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Sleet" Version="2.3.12" PrivateAssets="all" />
  </ItemGroup>

</Project>

Version 2.3.12 successfully restores, while 2.3.17 (and every version following that) fails with:

error NU1202: Package Sleet 2.3.17 is not compatible with netcoreapp2.1 (.NETCoreApp,Version=v2.1). Package Sleet 2.3.17 supports: netcoreapp2.0 (.NETCoreApp,Version=v2.0) / any
error NU1212: Invalid project-package combination for Sleet 2.3.17. DotnetToolReference project style can only contain references of the DotnetTool type

Setting PackAsTool=true on that project, as suggested somewhere on the internets also doesn't fix it.

This makes the package effectively unusable as a reference for projects that invoke it directly (i.e. Sleet.Azure.

Note, also, that using DotNetCliToolReference instead of PackageReference fails in the exact same way too.

Reproduced with: Microsoft (R) Build Engine version 16.0.461+g6ff56ef63c and Microsoft (R) Build Engine version 16.0.461+g6ff56ef63c

Thanks!

emgarten commented 5 years ago

I wonder if the exe should be moved to a new package id that isn't a dotnet tool.

Is there a good way to write a package that works for both desktop msbuild and dotnet? Today I assume this only works for desktop msbuild since it uses the exe.

emgarten commented 5 years ago

@kzu a non-tool package with sleet.exe is available here: https://www.nuget.org/packages/sleetexe