I have a nuget proxy on Nexus (v 3.9.0-01) on an internal network. I haven't populated the local Nexus repo myself (and don't know how it was done or if any issues arose), however, I can upload new packages manually. The build takes place on Bamboo agent and cannot be connected to the public repository.
Because of the isolation, I have to run dotnet build
/ dotnet publish
with --no-restore
and restore the packages using dotnet restore $projectPath --source $localNexus --runtime win-x64
The packages are being restored just fine until NuGet.Frameworks.4.7.0
. This package exists in 5 different versions (as far as I can tell exact copy of the official nuget repo), just not plain 4.7.0 (which doesn't exist in the official repo either). Then, dotnet restore
produces the following output:
build 20-Jun-2018 16:24:26 info : GET https://nexus.***.***.***.au/repository/nuget.org-proxy/Microsoft.CodeAnalysis.Workspaces.Common/2.8.0
build 20-Jun-2018 16:24:27 error: The feed 'https://nexus.***.***.***.au/repository/nuget.org-proxy/ [https://nexus.***.***.***.au/repository/nuget.org-proxy/]' lists package 'NuGet.Frameworks.4.7.0' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again.
build 20-Jun-2018 16:24:27 error: Unable to find package 'NuGet.Frameworks.4.7.0'.
The restore operation fails even if I force the package using dotnet add $projectPath
package --source $localNexusbefore running
dotnet restore`.
Note: this package is a dependency of Microsoft.VisualStudio.Web.CodeGeneration.Design
in my project.
Possibly related: https://issues.sonatype.org/browse/NEXUS-6159 (tagged with different Nexus version)
Questions:
dotnet package add
?With the release of version 2.9, NuGet support is available in Nexus Repository Manager Pro and Nexus Repository Manager OSS.
The dotnet restore command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project file.
nuget restore will ensure all of your NuGet dependencies are downloaded and available to your project. Whereas dotnet restore is a complete restoration of all NuGet dependencies as well as references and project specific tools. Meaning that if you run nuget restore , you are only restoring NuGet packages.
Restore NuGet packagesNavigate to Tools > Options > NuGet Package Manager > General, and then select the Allow NuGet to download missing packages check box under Package Restore. Enabling Restore NuGet Packages. In Solution Explorer, right-click the solution, and then select Restore NuGet Packages.
Having the exact same problem with Nexus 3.10, it appears this is resolved in 3.14 according to this Nexus issue; https://issues.sonatype.org/browse/NEXUS-17611
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With