6

I wrote a very simple C# .Net Framework application and added some unit tests. Now, trying to check the coverage using coverlet. Getting error MSB4184.

The expression "[System.Version]::Parse('')" canot be evaluated. Version string portion was too short or too long. (parameter 'input' ).

Does anyone encounter such an error?

Mark Cooper
  • 6,738
  • 5
  • 54
  • 92
Anel
  • 61
  • 1
  • 2

2 Answers2

5

One way I got around this issue was by renaming (or deleting) the coverlet.collector directory in your $HOME\.nuget\packages directory. Close Visual Studio completely, then re-open your solution or project.

File Explorer with renamed coverlet.collector directory

Edward J. Stembler
  • 1,932
  • 4
  • 30
  • 53
2

Coverlet has some limitations. It only supports SDK-style projects and in some cases only .NET Core test projects. This is not an issue if you start a new test project in a solution because you can mix up project types.

But migration of an existing old test project to an SDK style .NET Core project could be necessary.

https://github.com/coverlet-coverage/coverlet#Quick-Start has more information about the requirements.

Marcel Melzig
  • 363
  • 6
  • 13