Coverlet: error MSB1009

Created on 2 Oct 2018  路  5Comments  路  Source: coverlet-coverage/coverlet

$ ls
bin Controllers obj ReactCore.Tests.Unit.csproj Services
$ dotnet test /p:CollectCoverage=true
MSBUILD : error MSB1009: Project file does not exist.
Switch: p:CollectCoverage=true

Hi guys, any ideas why I have this error?

Thanks,

A

Most helpful comment

Note for those who find this and are also using the bash terminal... The following works:
dotnet test -p:CollectCoverage=true

All 5 comments

It's a MS error, so try to test first before using coverlet

I am using bash terminal to run this. And "dotnet test" will not have this issue.
Then I switched to VS PM console. Now both can run.

Thank you all the same.

Note for those who find this and are also using the bash terminal... The following works:
dotnet test -p:CollectCoverage=true

@kellystuard Is the format -p:CollectCoverage=true preferred over /p:CollectCoverage=true as shown in the documentation?

The dash (-) format is for use in the bash terminal. The forward-slash (/) format works for PowerShell.
If you're using the bash terminal and the forward-slash, you get this weird MSB1009 error.

Was this page helpful?
0 / 5 - 0 ratings