C
C#4w ago
Kiel

How to publish/deploy a project which has dependencies on a private MyGet feed

Hi all, I've been experiencing issues publishing my project via docker. It fails to restore packages for one or more projects because they take a dependency on a NuGet package hosted on a private MyGet feed. What's the correct and/or best way to alleviate this? I think in the past I directly included the MyGet feed URL in the .csproj file(s) somewhere to indicate where the package was referenced from...but I don't know if that's the best, recommended, or easiest way to do it. The errors (during docker build) all read to the tune of error NU1102: Unable to find package Disqord.Core with version (>= 1.0.0-alpha5.75) [/src/Administrator/Administrator.csproj]
2 Replies
becquerel
becquerel4w ago
generally you would create a nuget.config file which specifies your package sources, and ensure it's copied into the container dotnet restore will automatically look for that file if it's in the solution tree, but you can also pass it explicitly as an argument iirc
becquerel
becquerel4w ago
nuget.config File Reference
NuGet.Config file reference including the config, bindingRedirects, packageRestore, solution, and packageSource sections.

Did you find this page helpful?