FortuneN / FineCodeCoverage

Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
https://marketplace.visualstudio.com/items?itemName=FortuneNgwenya.FineCodeCoverage
Other
506 stars 38 forks source link

FCC causes conflicts in project file if it is open in the editor window when running tests (MS Coverage) #402

Closed damirarh closed 4 months ago

damirarh commented 4 months ago

Installed product versions

Description

With MsCodeCoverage enabled, the extension causes VS to generate backup copies of .csproj file because of conflicts if that project file is opened in the editor window.

Steps to recreate

  1. Enable MsCodeCoverage mode for the extension.
  2. Open a project with some tests.
  3. Open the .csproj file of the project in the editor window.
  4. Run the tests at least twice

Current behavior

During the second test run VS show a warning because of a conflict in the project file and creates a backup file in the folder. image

Expected behavior

The extension should work as it does when the .csproj file is not open in the editor window, i.e. no conflicts in the project file should happen.

Side Notes

devenv_6hGVPc47k1

tonyhallett commented 4 months ago

It is necesary to write to the project file. If you do not like this functionality you can create your own runsettings file or do not use ms code coverage if that is suitable.

damirarh commented 4 months ago

I'm perfectly fine with this functionality. My only issue are the conflicts which happen if I have the project file accidentally open when running the tests. It took me a while to figure out what was causing the conflicts all of a sudden and how to prevent them. Now that I know, it's more or less a non-issue for me. I still prefer MS Coverage to the old style which comes with its own set of potential issues.

I was hoping the conflicts were caused by some kind of race condition with the editor window, causing it to think that it contains unsaved changes. And could therefore be circumvented. If not, it might be a good idea to document the behavior in a troubleshooting section. It's likely that others will encounter it as well.

tonyhallett commented 4 months ago

I will add to the readme that FCC writes to the project file and mention the warning you encountered. Although I do not get any warning when running tests with the test project file open.

tonyhallett commented 4 months ago

Updated readme.