Artavazd Balayan
Artavazd Balayan

Reputation: 2423

OpenCover keeps saying "No results, this could be for a number of reasons" for .NET Core

When I run OpenCover.Console.exe, it runs tests, but code coverage is failing: OpenCover Error

What's wrong? How to fix it?

Upvotes: 3

Views: 2379

Answers (5)

Youri Leenman
Youri Leenman

Reputation: 248

The OpenCover version that worked for be along with -register or -register:administrator was 4.7.1221. When I used 4.6.519 it didn't work.

<DebugType>Full<DebugType> didn't change anything in my case

Upvotes: 0

Nick
Nick

Reputation: 358

On VS2022, Framework .NET 4.5, nunit3-console.exe

-register:administrator

worked for me rather than full PDB files

Upvotes: 0

yancyn
yancyn

Reputation: 959

Change to use -register:administrator instead. That works for me. see https://github.com/OpenCover/opencover/issues/849#issuecomment-454058818.

Upvotes: 1

Prashant Pratik
Prashant Pratik

Reputation: 61

What worked for me was to remove :user from register:user. Just used register and that solved the problem.

Upvotes: 5

Artavazd Balayan
Artavazd Balayan

Reputation: 2423

Make sure that build settings Debugging information for that project is set to Full(Project->Properties->Build->Advanced). debugging infromation

The same can be done by modifying .csproj file and adding <DebugType>Full</DebugType> node under <PropertyGroup>. Change csproj

Source: Setting up Coveralls with OpenCover for a .NET Core project

Upvotes: 6

Related Questions