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

NuGet v3 should honor developmentDependency=true in nuspec file #520

Closed
AArnott opened this issue May 2, 2015 · 20 comments
Closed

NuGet v3 should honor developmentDependency=true in nuspec file #520

AArnott opened this issue May 2, 2015 · 20 comments
Assignees

Comments

@AArnott
Copy link
Contributor

AArnott commented May 2, 2015

When a nuspec file has this tag:

<developmentDependency>true</developmentDependency>

Installing that package should cause a similar attribute to be added to the packages.config file. But when I run this command

Install-Package StyleCop.Analyzers -version 1.0.0-alpha005

to install a package with that tag, I get this in my packages.config file

<package id="StyleCop.Analyzers" version="1.0.0-alpha005" targetFramework="net452" userInstalled="true" />
@yishaigalatzer yishaigalatzer added this to the 3.0.0-RTM milestone May 2, 2015
AArnott added a commit to nuproj/nuproj that referenced this issue May 2, 2015
This is all it took for nuproj to behave correctly.
@yishaigalatzer
Copy link

@emgarten note this for the uap work - need to be translated (I think the feature is supported in nuget.config already)

@davidfowl
Copy link
Member

userInstalled="true"?

@yishaigalatzer
Copy link

@davidfowl that's a half baked idea that got in, it is pretty much a useless to mimic transitive.

@AArnott
Copy link
Contributor Author

AArnott commented May 2, 2015

I've noticed that userInstalled is always set to true even when it was brought in by another package. So ya, is that going away or should I file a bug for that too?

@yishaigalatzer
Copy link

It's a fail. But we are not touching it for now. Feel free to file

@AArnott
Copy link
Contributor Author

AArnott commented May 2, 2015

Done #523

danliu added a commit to NuGetArchive/NuGet.PackageManagement that referenced this issue Jun 5, 2015
@danliu
Copy link

danliu commented Jun 5, 2015

@danliu danliu closed this as completed Jun 5, 2015
@yishaigalatzer yishaigalatzer reopened this Jun 5, 2015
@yishaigalatzer yishaigalatzer modified the milestones: UWP transitive support, 3.0.0-RTM Jun 5, 2015
@yishaigalatzer yishaigalatzer assigned emgarten and unassigned danliu Jun 5, 2015
@yishaigalatzer
Copy link

Re-opened as follow up item for UWP

@anurse

@analogrelay
Copy link

We only need to consider this when we start packaging project.json based projects as packages. In theory, DNX may be considering a similar feature, so NuGet should co-ordinate with this. The only behavior this feature provides is the following:

  1. A package may have "developmentDependency=true" in it's nuspec
  2. When installed, that marker is preserved in the packages.config (now project.json)
  3. When the project is packed, the developmentDependencies are NOT added as dependencies of the produced package.

So this only applies to implementing nuget pack on project.json projects.

@AArnott
Copy link
Contributor Author

AArnott commented Jun 7, 2015

This still doesn't work for packages.config scenarios. My repro is with NuGet 3.0.60605.535 and D14Rel 23004.00

  1. Create C# console app
  2. install-package nerdbank.gitversioning -pre

It creates a package.config file that is missing the developmentDependency="true" attribute

@yishaigalatzer yishaigalatzer assigned danliu and unassigned emgarten Jun 7, 2015
@danliu
Copy link

danliu commented Jun 9, 2015

@AArnott, looks like you are using the VSIX from the dev branch and the fix was not in it yet, due to recent build issues. Once we update the VSIX of dev branch, you should see the fix.

If you install latest NuGet from 3.0-rtm branch now, the issue is fixed.

capture

@danliu
Copy link

danliu commented Jun 9, 2015

reassign to @anurse

danliu added a commit to NuGetArchive/NuGet.PackageManagement that referenced this issue Jun 9, 2015
@danliu danliu reopened this Jun 9, 2015
@danliu
Copy link

danliu commented Jun 9, 2015

Re-opened as follow up item for UWP

@kzu
Copy link

kzu commented Oct 14, 2016

Reopening since this is still happening for project.json-based PCLs and CPS projects.

Repro on VS015 Update 3 with NuGet 3.5.0 RTM:

  • Create a .NETCore class library or a PCL that targets .NETStandard
  • Install the IFluentInterface nuget package, which has the developmentDependency flag
  • Check the resulting project.json: it does not have anything that flags the dependency as a development dependency.

/cc @emgarten

@kzu kzu reopened this Oct 14, 2016
@yishaigalatzer
Copy link

I don't think we want to fix it in PJ, but we should fix it in package ref if needed

@kzu
Copy link

kzu commented Oct 14, 2016

Since package ref seems like it's going to be an MSBuild 15+ only feature, I think this must be fixed in PJ. There's very little chance that NuGetizer can work properly if there's no support for this.

/cc @mhutch

I'm happy to send a PR that fixes it if someone points me in the right direction.

@kzu
Copy link

kzu commented Oct 17, 2016

/cc @migueldeicaza this is a blocker for proper NuGetizer support on VS2015.

@kzu
Copy link

kzu commented Oct 24, 2016

Solved in NuGetizer by allowing easy removal of inferred package references.

@bbowman
Copy link

bbowman commented Nov 7, 2016

@kzu Just for my understanding here, there is nothing "wrong" with having a developmentDependency tacked on to the produced package except that its extra baggage right? I assume that it would be mostly harmless unless a brought in dev dep conflicted with a build environment for some reason?

@kzu
Copy link

kzu commented Nov 7, 2016

@bbowman think about something like GitInfo/GitVersion: why would you want that to propagate? The fact that you are using it for versioning your assemblies shouldn't dictate what your package consumers use for versioning theirs

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

8 participants