Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hi,

I hope this post is in the right place.

Is it possible to get the Generated Path Property for a NuGet Package dependency?

I've created a NuGet package that depends on a third-party package that I want copied into my Project's directory .
The third-party NuGet package has not enabled copying to the output directory using the PackageReference style (works correctly using packages.config) and so the content ends up in the global packages directory.

I've added a .targets file to my NuGet package distribution in /build that copies the contents from the global location using the $(PkgNuGetName) variable, but this variable is empty because the GeneratePathProperty for this dependency is disabled I assume.

Please let me know if anything isn't clear or you need additional information!

Thanks for your time,
Levie

You must be logged in to vote

Replies: 3 comments

Comment options

Why not suggest package consumers to reference your package dependence directly ?

https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#generatepathproperty

You must be logged in to vote
0 replies
Comment options

Because then it's up to the user to retrieve two NuGet packages and also set the appropriate GeneratePathProperty on the second NuGet. The idea is to create one "seamless" experience for developers. This approach isn't intuitive but it seems to be about the only option.

You must be logged in to vote
0 replies
Comment options

I'm looking for a similar feature (not to copy contents from the 3rd party package but to access some of its build targets from my own build target). Is it possible to get the path to the transitive dependency without forcing the end-user to consume the transitive dependency explicitly?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.