dotnet test /p option not supported when using a dll path

Viewed 257

I have a dotnet core project that I have already compiled:

> dotnet build --configuration Release

If I try to run the test using the resulting dll using the /p option, it fails:

> dotnet test .\bin\Release\netcoreapp3.1\MyProject.dll /p:CollectCoverage=true
Microsoft (R) Test Execution Command Line Tool Version 16.10.0
Copyright (c) Microsoft Corporation.  All rights reserved.

The argument /p:CollectCoverage=true is invalid. Please use the /help option to check the list of valid arguments.

Does anybody know how I could pass the /p option when providing a dll?

Note that I know that I could use the --no-build option like this:

> dotnet test --configuration Release --no-build /p:CollectCoverage=true

Unfortunately, for some reasons that would be too long to explain here, I can't use that option. I really have to call dotnet test by providing a path to an already existing dll.

0 Answers
Related