Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error NU1100: Unable to resolve in Module "Run quality tests" #7200

Open
svenvandeschoot opened this issue Apr 5, 2023 · 3 comments
Open

Comments

@svenvandeschoot
Copy link

I'm working through the Azure DevOps modules and I've come to a roadblock on https://learn.microsoft.com/en-us/training/modules/run-quality-tests-build-pipeline/4-add-unit-tests

I fetch the upstream branch, do a checkout and then proceed to the subsection "Run the tests locally" where I get a bunch of errors (see below). I have no idea on how to proceed to fix this, and am blocked for the remainder of the course :/

`$ dotnet build --configuration Release
MSBuild version 17.3.2+561848881 for .NET
Determining projects to restore...
C:\Workdir\MyApps\repo\mslearn-tailspin-spacegame-web\Tailspin.SpaceGame.Web.Tests\Tailspin.SpaceGame.Web.Tests.csproj : error NU1100: Unable to resolve 'nunit (>= 3.13.2)' for 'net6.0'.
[C:\Workdir\MyApps\repo\mslearn-tailspin-spacegame-web\Tailspin.SpaceGame.Web.sln]
C:\Workdir\MyApps\repo\mslearn-tailspin-spacegame-web\Tailspin.SpaceGame.Web.Tests\Tailspin.SpaceGame.Web.Tests.csproj : error NU1100: Unable to resolve 'NUnit3TestAdapter (>= 3.17.0)' f
or 'net6.0'. [C:\Workdir\MyApps\repo\mslearn-tailspin-spacegame-web\Tailspin.SpaceGame.Web.sln]
C:\Workdir\MyApps\repo\mslearn-tailspin-spacegame-web\Tailspin.SpaceGame.Web.Tests\Tailspin.SpaceGame.Web.Tests.csproj : error NU1100: Unable to resolve 'Microsoft.NET.Test.Sdk (>= 16.10
.0)' for 'net6.0'. [C:\Workdir\MyApps\repo\mslearn-tailspin-spacegame-web\Tailspin.SpaceGame.Web.sln]
Failed to restore C:\Workdir\MyApps\repo\mslearn-tailspin-spacegame-web\Tailspin.SpaceGame.Web.Tests\Tailspin.SpaceGame.Web.Tests.csproj (in 120 ms).
1 of 2 projects are up-to-date for restore.

Build FAILED.

C:\Workdir\MyApps\repo\mslearn-tailspin-spacegame-web\Tailspin.SpaceGame.Web.Tests\Tailspin.SpaceGame.Web.Tests.csproj : error NU1100: Unable to resolve 'nunit (>= 3.13.2)' for 'net6.0'.
[C:\Workdir\MyApps\repo\mslearn-tailspin-spacegame-web\Tailspin.SpaceGame.Web.sln]
C:\Workdir\MyApps\repo\mslearn-tailspin-spacegame-web\Tailspin.SpaceGame.Web.Tests\Tailspin.SpaceGame.Web.Tests.csproj : error NU1100: Unable to resolve 'NUnit3TestAdapter (>= 3.17.0)' f
or 'net6.0'. [C:\Workdir\MyApps\repo\mslearn-tailspin-spacegame-web\Tailspin.SpaceGame.Web.sln]
C:\Workdir\MyApps\repo\mslearn-tailspin-spacegame-web\Tailspin.SpaceGame.Web.Tests\Tailspin.SpaceGame.Web.Tests.csproj : error NU1100: Unable to resolve 'Microsoft.NET.Test.Sdk (>= 16.10
.0)' for 'net6.0'. [C:\Workdir\MyApps\repo\mslearn-tailspin-spacegame-web\Tailspin.SpaceGame.Web.sln]
0 Warning(s)
3 Error(s)

Time Elapsed 00:00:00.61`

@svenvandeschoot
Copy link
Author

I'm not sure if this was the right fix, but I found a Reddit post concerning a similar issue and they recommended checking the nuget source. It turns out I didn't have one, and after entering the commands below, my dotnet build worked first try.

I hope mslearn picks this up to correct the course module prerequisites, or at the very least it helps someone at some point.

$ dotnet nuget list source
No sources found.

$ dotnet nuget add source --name nuget.org https://api.nuget.org/v3/index.json
Package source with Name: nuget.org added successfully.

$ dotnet nuget list source
Registered Sources:

  1. nuget.org [Enabled]
    https://api.nuget.org/v3/index.json

@redflAg00
Copy link

Thank you very much! I had the exact same error and your solution fixed it for me.
I too hope MS will review their MS-Learn repos more regularly as i stumbled on a few errors, which i was able to fix, thx to this awesome community.

@dholyfield
Copy link

another thanks coming your way, this fixed the issue for me as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants