0

I have a test project and I was running the test project by setting some variable using cmd file. This is the file content.

#launchtests.cmd
SETLOCAL
SET MyTestProperty='ValueFromCommand'
DOTNET TEST MyTestProject.csproj

I kept this in the same folder of project file location. But when I try executing this via Powershell, Getting below error.

Could not execute because the specified command or file was not found. Possible reasons for this include:

  • You misspelled a built-in dotnet command.
  • You intended to execute a .NET program, but dotnet-TEST does not exist.
  • You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

enter image description here

Did I missed to install anything here?

Aneez
  • 157
  • 1
  • 2
  • 14
  • 1
    If you are just trying to run tests from the dotnet CLI and you have the SDK installed, `dotnet test ` will suffice. No need for any capital letters or hyphens. – Ash Jan 30 '22 at 15:36
  • @Ash Thanks. It worked. Never thought Caps will cause issue. – Aneez Jan 30 '22 at 17:42

1 Answers1

0

As mentioned by @Ash in comment, Caps was issue. When I applied dotnet test MyTestProject.csproj It worked.

Aneez
  • 157
  • 1
  • 2
  • 14