Reputation: 2423
I've got a public nuget package that has a prerelease version that depends on the aspnetwebstacknightly feed on myget. Does anyone know if there's a way to create a dependency in my package on that feed? I haven't been able to find anything helpful. I'm guessing there's no way to do this, but just want to try SO as a last resort. :)
Upvotes: 1
Views: 418
Reputation: 14810
You can have the dependency defined in your package. The only issue is that when you push yours to nuget.org without that dependency being present there, your package consumers will have to configure the MyGet feed as well for that dependency to be resolved during install time.
More precisely, the MyGet feed should be put below the NuGet.org feed, and your package should be installed using the "All" aggregate package source.
You could communicate this in your package readme.txt or in your package metadata to have it visible on the NuGet.org package details page. You could also try to add some PowerShell scripts and try to find a way around it, but the issue you're fighting with is by design. However, I would not recommend doing any of this.
Basically, you'll have this issue as long as your dependency has not been pushed to NuGet.org. Why not expose your pre-release package on MyGet and configure the aspnetwebstacknightly MyGet feed as an upstream package source in your feed? Be sure to enable the "proxy" checkbox for this package source so that your dependency will be resolved as well without consumers needing to configure both feeds (installing your package from your feed would also fetch your dependency from your feed - which under the hood then queries the aspnetwebstacknightly feed).
Hope that helps!
Upvotes: 3