coverlet icon indicating copy to clipboard operation
coverlet copied to clipboard

cannot access the file, because it is being used by another process

Open ChristopherPope opened this issue 3 years ago • 5 comments

I understand this problem was fixed by #869 but I am experiencing the issue at my work and I believe this has to do with our environment at work because I cannot reproduce it at home.

I am using Coverlet.Collector 3.1.2, NUnit 3.13.2, and .Net Core 3.1 and have created a minimal test project to reproduce this at work (but not at home)

I see the RetryAttempts count in InstrumentationHelper, could this be modified to accept a parameter given to the dotnet CLI so that I could increase it and perhaps fix my problem?

I cannot build Coverlet at work because it is using an older version of Newtonsoft.Json, nor can I use the language features of C# 8.0

Thanks.

ChristopherPope avatar Feb 09 '22 16:02 ChristopherPope

I was able to build coverlet.collector at work and create a Nuget package. However, when running dotnet test --collect:"XPlat Code Coverage" I get an error.

The error states that it cannot load Newtonsoft.Json v13.0.0.0 and is at Coverlet.Collector.DataCollection.CoverageWrapper.GetGoverageResult(). That version of Newtonsoft, 13.0.0.0, doesn't exist on Nuget so I do not know what triggered the dependency.

My goal is to set the RetryAttempts to 13 and wait a max of 16 seconds, I know that if 8 seconds wasn't long enough that 16 seconds probably will not help but I have to at least try.

ChristopherPope avatar Feb 10 '22 13:02 ChristopherPope

Hi, do you have antivirus on that machine? Users sometimes have that issue, and the solution is to remove the dev dirs from the antivirus check.

MarcoRossignoli avatar Feb 20 '22 11:02 MarcoRossignoli

Another solution we were thinking about is to avoid to "restore" instrumented assemblies at the end if the compilation is no more used(providing a flag).

MarcoRossignoli avatar Feb 20 '22 11:02 MarcoRossignoli

@MarcoRossignoli is there any way to test that? I have seen that there is disableRestoreModules. Is there any possibility to set that to True from the outside?

zanseb avatar Sep 08 '22 14:09 zanseb

This issue is stale because it has been open for 3 months with no activity.

github-actions[bot] avatar Sep 04 '23 00:09 github-actions[bot]