Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

SourceLink.Create.CommandLine nuget should be a development dependency #330

Closed
ta-stott-oe opened this issue Apr 19, 2018 · 6 comments
Closed

Comments

@ta-stott-oe
Copy link

If I install SourceLink.Create.CommandLine v.2.8.0 in a .NET Framework 4.5 project, it doesn't have the attribute developmentDependency="true" in packages.config.

If my host project is to be packed into a nuget itself, this means SourceLink.Create.CommandLine is identified as a dependency by default and installed into downstream projects. I don't think this is the desired behaviour.

Fantastic tool by the way, thanks very much!

@ctaggart
Copy link
Owner

ctaggart commented Apr 19, 2018

It looks like developmentDependency was added to nuget 2.7 back in November of 2016. A lot has changed since then to the tooling.
https://docs.microsoft.com/en-us/nuget/release-notes/nuget-2.7#development-only-dependencies

How are you installing SourceLink.Create.CommandLine? Did you follow the quick start. In your project file, do you have PrivateAssets="All"?

<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.0" PrivateAssets="All" /> 

@paulomorgado
Copy link
Contributor

The same goes for the SourceLink package.

@ta-stott-oe
Copy link
Author

Hi @ctaggart, actually for the time being I'm still using packages.config (not <PackageReference>). I installed SourceLink using the Nuget GUI in VS 2017.

I think if you can add the following to your .nuspec, this will automatically install SourceLink as a development dependency for those of us still using packages.config:

<metadata>
    ...
    <developmentDependency>true</developmentDependency>

It looks like Nuget regressed slightly with <PackageReference> because it doesn't respect this developmentDependency flag anymore:
https://github.com/NuGet/Home/wiki/DevelopmentDependency-support-for-PackageReference
NuGet/Home#4125

But hopefully that will be fixed at some point, in which case the .nuspec change above should mean PrivateAssets="All" is automatically set for <PackageReference> users who install SourceLink.

@paulomorgado
Copy link
Contributor

For SDK projects, it requires a DevelopmentDependency property on the project,

I've submited a PR with this: #331

@ctaggart
Copy link
Owner

Assuming this is fixed by #331. I just published 2.8.1. Thanks @paulomorgado

@paulomorgado
Copy link
Contributor

Always glad to help, @ctaggart.

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

No branches or pull requests

3 participants