-
Notifications
You must be signed in to change notification settings - Fork 252
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
Feature request: Non-transitive package dependencies? #3964
Comments
This is supported in The reason it's so granular is because you want transitivity for runtime, but not compilation. You get that full expressiveness with these flags. Unfortunately, this doesn't work with the way |
@davidfowl Great news to hear!
The https://github.com/NuGet/Home/wiki/%5BSpec%5D-Managing-dependency-package-assets <dependencies>
<group>
<dependency id="packageB" version="1.0.0" include="all" />
</group>
</dependencies> but official docs has no mention of If yes: what flag should be used for my use case? <dependency id="PackageY" version="1.2.3" exclude="compile" /> , right? |
UPD: Looks like duplicate to #3052 I'm still interested in getting an answer though : ) |
Yes. /cc @emgarten You guys should update the official docs |
The docs for this are being tracked here #4551 |
VS2015 upd3, nuget 3.5 (latest one), .net4.6 framework project.
Use case:
I have a
package X
depending on third-partypackage Y
. By default (Visual Studio 2015 Upd3 + nuget 3.5) any project referencing topackage X
will be updated with reference topackage Y
too. The issue is, customers ofX
do not need reference toY
at all, as API ofpackage Y
is not and should not be exposed to customers. There should be a way to mark such dependencies.Expected implementation of the feature:
Package Y
is included as(
private
is just a placeholder, have no idea for better name).package X
, content ofpackage Y
should be copied into output folder on build, butpackage Y
should not be added into project references.Possible workarounds:
Theoretically we can include sources of the infrastructure
package Y
into ourproject X
(in our case both projects are opensource under MIT license) but I'd prefer to use more or less standard approach.Why we need it:
The case we're investigating right now: we have a nuget package with test helper that ensures that PDB files matches to the sources (references
Microsoft.DiaSymReader
package). We do not want all our test projects to referenceMicrosoft.DiaSymReader
assembly.More or less theoretical one (not an issue for now but will be a problem if the project will be pushed into production): custom script engine that uses Roslyn to compile and run the scripts. We do not want references to the Roslyn assemblies in all projects that will use our script engine.
Latter case is much worse as we cannot merge roslyn sources into our project, obviously, and cannot distribute roslyn binaries as a part of our package, too.
Real-world example:
There's a package with exactly same issue:
Benchmark.Net
.Create a new project targeting .net 4.6+, add a reference to
Benchmark.Net
aand:Also asked on stackoverflow.
The text was updated successfully, but these errors were encountered: