Search code examples
.netdotnet-cli

How may I use dotnet test specifying my project, like I used to do?


How may I use dotnet test specifying my project, like I used to do?

I had been using this command for 5 months:

dotnet test ./path/to/MyTestFolder/MyTestProject.csproj

Yesterday it stopped work with this error:

Unrecognized command or argument './path/to/MyTestFolder/MyTestProject.csproj'

Doc says this syntax is ok.

But the tool help says:

dotnet test -h

Description: Driver de Teste do .NET

Usage: dotnet test [options] [[--] ...]]

Extra details:

  • The path is fine (I checked with a dir).
  • I tried to replace slash by backslash with no success.
  • I tried with Command Prompt, Windows Powershell, Developer Command Prompt for VS 2022, Developer Powershell for VS 2022.
  • Using Windows 11 with 2 SDK installed: 6.0.400, 7.0.102

Solution

  • I installed the sdk 7.0 and it went back to working normally.

    https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-7.0.202-windows-x64-installer