Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mixed with <PackageReference PrivateAssets=All doesnt download the nupkg #2930

Closed
enricosada opened this issue Dec 5, 2017 · 4 comments
Closed

Comments

@enricosada
Copy link
Collaborator

enricosada commented Dec 5, 2017

Description

If not already in cache, the PackageReference is not downloaded

Atm is not yet possibile to specify that type of dependency in paket only, ref #2370

Repro steps

  • dotnet new lib -lang F#
  • make it paket ready
  • add <PackageReference Include="SourceLink.Create.CommandLine" Version="2.1.1" PrivateAssets="All" />
  • dotnet restore

Expected behavior

the package reference is added, and doesnt exists in the deps after dotnet pack

Actual behavior

fails with

E:\temp\provactag\provactag.fsproj : error NU1100: Unable to resolve 'SourceLink.Create.CommandLine (>= 2.1.1)' for '.NETStandard,Version=v2.0'.

Known workarounds

Create a group, and restore it before the dotnet restore, with the exact version, so the nupkg is in cache

group NetCoreTools
  storage: none
  source https://nuget.org/api/v2

  nuget SourceLink.Create.CommandLine 2.1.1

and paket restore -g NetCoreTools

after that, dotnet restore works

@forki
Copy link
Member

forki commented Dec 5, 2017 via email

@enricosada
Copy link
Collaborator Author

enricosada commented Dec 5, 2017

Closing so.

It always worked for me, minus this issue, i was thinking was an ok scenario (paket + some packagerefernce).
I use it a lot for Microsft.Test.Sdk, etc, pratically all sdks
@forki there is a way to configure paket to add a "development" dependency, so is not going in nupkg after dotnet pack?

enricosada added a commit to enricosada/Paket that referenced this issue Dec 5, 2017
enricosada added a commit to enricosada/Paket that referenced this issue Dec 5, 2017
@forki
Copy link
Member

forki commented Dec 5, 2017 via email

@enricosada
Copy link
Collaborator Author

enricosada commented Dec 6, 2017

@forki info is in #2370 (comment)

The added Assets data to nuget deps, to change how deps flow.
with Include/Exclude/Private as modifier. you can see that in a generated nuspec or a PackageReference

  • Compile – are the contents of the lib folder available to compile against
  • Runtime – are the contents of the runtime folder distributed
  • ContentFiles – are the contents of the contentfiles folder used
  • Build – do the props/targets in the build folder get used
  • Native - are the contents from native assets copied to the output folder for runtime
  • Analyzers – do the analyzers get used

Plus All = shortcut for all in that list, None = none of that list

Pratically, if PrivateAssets=All, mean all these type of assets are private of the project (so no need to add the deps in the nupkg dep list)

in netcore is easier, because in paket target file you create the PackageReference items

Sorry, but atm no time to implement that :( but happy to help undestand how works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants