E
E
Eugenue Cesarevich2021-12-29 16:33:31
C++ / C#
Eugenue Cesarevich, 2021-12-29 16:33:31

How can I resolve the NU1100 error?

Alas, I am a complete zero in C#. They gave me a simple homework at the university, to finish one class. When checking the project through the dotnet test command, an error occurs:

D:\my\homework\2021_december\c#\PracticeOne\Practice\Test\Test.csproj : error NU1100: Failed to resolve 'Microsoft.NET.Test.Sdk (>= 16.11.0)' for 'net6.0' . [D:\my\homework\2021_december\c#\PracticeOne\Practice\Practice.sln]
D:\my\homework\2021_december\c#\PracticeOne\Practice\Test\Test.csproj : error NU1100: Failed to resolve " NUnit (>= 3.13.2)" for "net6.0". [D:\my\homework\2021_december\c#\PracticeOne\Practice\Practice.sln]
D:\my\homework\2021_december\c#\PracticeOne\Practice\Test\Test.csproj : error NU1100: Failed to resolve " NUnit3TestAdapter (>= 4.0.0)" for "net6.0". [D:\my\homework\2021_december\c#\PracticeOne\Practice\Practice.sln]
D:\my\homework\2021_december\c#\PracticeOne\Practice\Test\Test.csproj : error NU1100: Failed to resolve 'coverlet.collector (>= 3.1.0)' for 'net6.0'. [D:\my\homework\2021_december\c#\PracticeOne\Practice\Practice.sln]
Failed to restore D:\my\homework\2021_december\c#\PracticeOne\Practice\Test\Test.csproj (in 534 ms) .
Projects updated for recovery: 1 of 2.


Here is the actual Test.csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Nullable>enable</Nullable>

    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
    <PackageReference Include="NUnit" Version="3.13.2" />
    <PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
    <PackageReference Include="coverlet.collector" Version="3.1.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\Practice\Practice.csproj" />
  </ItemGroup>

</Project>


How can I solve the problem? I understand that dependencies do not last. But what should I do in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nik Faraday, 2022-01-18
@NikFaraday

https://docs.microsoft.com/ru-RU/nuget/reference/e...
The error is not in the project configuration (the code you posted), but rather in the code itself or in the presence of incompatible packages. More details about the error on the link above.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question