setup-dotnet: [Workaround found] NuGet errors in Windows build: NU1101 No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
Description
I recently started getting failures in the Windows build for the dotnet action of my project, see https://github.com/csinkers/ualbion/runs/1574151895
Linux and macOS are still working fine, no project files / NuGet configurations have been changed since the last successful build. Sounds like it’s only looking for locally cached packages rather than using nuget.org.
Details
Yaml:
name: .NET Core
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.100
- name: Build with dotnet
run: dotnet build --configuration Release src/UAlbion/UAlbion.csproj
- name: Test with dotnet
run: dotnet test ./src/ualbion.sln --configuration Release
Platform: windows-latest Version: .NET Core 3.1.100 Action link: https://github.com/csinkers/ualbion/actions Error messages:
D:\a\ualbion\ualbion\src\Core\UAlbion.Core.csproj : error NU1101: Unable to find package SerdesNet. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages [D:\a\ualbion\ualbion\src\UAlbion\UAlbion.csproj]
D:\a\ualbion\ualbion\src\Core\UAlbion.Core.csproj : error NU1101: Unable to find package Microsoft.CodeAnalysis.FxCopAnalyzers. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages [D:\a\ualbion\ualbion\src\UAlbion\UAlbion.csproj]
D:\a\ualbion\ualbion\src\Core\UAlbion.Core.csproj : error NU1101: Unable to find package System.Memory. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages [D:\a\ualbion\ualbion\src\UAlbion\UAlbion.csproj]
D:\a\ualbion\ualbion\src\Core\UAlbion.Core.csproj : error NU1102: Unable to find package Newtonsoft.Json with version (>= 12.0.2) [D:\a\ualbion\ualbion\src\UAlbion\UAlbion.csproj]
Was this a regression from previous behavior? – Yes
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 26
- Comments: 17 (3 by maintainers)
Commits related to this issue
- Trying a workaraound for dotnet bug https://github.com/actions/setup-dotnet/issues/155 — committed to tgstation/tgstation-server by Cyberboss 4 years ago
- Work around nuget issue (https://github.com/actions/setup-dotnet/issues/155) — committed to csinkers/ualbion by csinkers 4 years ago
- Avoid crash in GitHub actions on Windows environment ⚙️🔧 Avoid these errors that recently started appearing in GitHub actions Windows environment: ``` [...] D:\a\elm-fullstack\elm-fullstack\impleme... — committed to pine-vm/pine by Viir 4 years ago
- fix windows build failure by inserting a cleanup step per https://github.com/actions/setup-dotnet/issues/155#issue-770505417. — committed to zhouqingqing/qpmodel by zhouqingqing 4 years ago
- Added clean to workflow to fix CI bug https://github.com/actions/setup-dotnet/issues/155 — committed to Mutagen-Modding/Mutagen by Noggog 4 years ago
- Bypassing dotnet restore issue https://github.com/actions/setup-dotnet/issues/155 — committed to Ilia-Kosenkov/Backports by Ilia-Kosenkov 4 years ago
- Use latest channel version Use fix from https://github.com/actions/setup-dotnet/issues/155 — committed to poveden/EliteChroma by deleted user 3 years ago
- Apply Github Action fix https://github.com/actions/setup-dotnet/issues/155 — committed to Handlebars-Net/Handlebars.Net.Extension.NewtonsoftJson by oformaniuk 3 years ago
- nuget issue workaround https://github.com/actions/setup-dotnet/issues/155#issuecomment-748452076 — committed to zaaml/lib by zaaml 3 years ago
- 💩 Remove buggy actions/setup-dotnet - ref actions/setup-dotnet#155 — committed to database64128/shadowsocks-uri-generator by database64128 3 years ago
- 🥨 ReadyToRun + SingleFile + Trim + InvariantGlobalization (#3) * 🥨 ReadyToRun + SingleFile + Trim + InvariantGlobalization * 📦 Apply same settings for release workflow * 💩 Remove buggy acti... — committed to database64128/shadowsocks-uri-generator by database64128 3 years ago
- Clear NuGet cache before building Fixes flakiness in Windows build See https://github.com/actions/setup-dotnet/issues/155 — committed to jskeet/functions-framework-dotnet by jskeet 3 years ago
- Clear NuGet cache before building Fixes flakiness in Windows build See https://github.com/actions/setup-dotnet/issues/155 — committed to GoogleCloudPlatform/functions-framework-dotnet by jskeet 3 years ago
- Workaround for NuGet restore issue Fixes random(?) "error NU1101: Unable to find package" errors during build. Most of the time the build works but some days this error appears and seems to persist. ... — committed to tetsuo13/PiwigoScreenSaver by tetsuo13 3 years ago
- NuGet config added to fix CI as suggested in https://github.com/actions/setup-dotnet/issues/155 — committed to MarcusWichelmann/MarcusW.VncClient by MarcusWichelmann 3 years ago
- Fix dotnet restore failing on windows-latest build https://github.com/actions/setup-dotnet/issues/155 — committed to DrSmugleaf/Smogon-Parser.NET by DrSmugleaf 3 years ago
- add nuget config to fix failed dotnet restore For more information see [here](https://github.com/actions/setup-dotnet/issues/155#issuecomment-761195782) — committed to ThisFunctionalTom/fsharp-hedgehog by ThisFunctionalTom 3 years ago
- Github Actions: Workaround windows-latest restore failures (#1957) See https://github.com/actions/setup-dotnet/issues/155. — committed to Ryujinx/Ryujinx by deleted user 3 years ago
- Added nuget cache cleanup to workaround nuget restore issues https://github.com/actions/setup-dotnet/issues/155. — committed to dawidkomorowski/geisha by dawidkomorowski 3 years ago
- add nuget config to fix failed dotnet restore For more information see [here](https://github.com/actions/setup-dotnet/issues/155#issuecomment-761195782) — committed to ThisFunctionalTom/fsharp-hedgehog by ThisFunctionalTom 3 years ago
Found the fix, add this before the build (Ofcourse change the bumbo-web stuff to your own projectfolder/name): - name: Clean run: dotnet clean ./Bumbo-Web/Bumbo-Web.sln --configuration Release && dotnet nuget locals all --clear
Another thing that solved the issue for me was adding a
nuget.config
with the following to my project’s root:@jasonleenaylor, also you can try this step as workaround:
I’ve opened the issue for this bug in dotnet/core repository: https://github.com/dotnet/core/issues/5881
adding this helps
I believe this is still a prevalent issue though that people will be looking for answers to. If not here, where should it be raised?