Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RunSettingsFilePath in csproj #312

Open
Soundman32 opened this issue Dec 14, 2022 · 6 comments
Open

RunSettingsFilePath in csproj #312

Soundman32 opened this issue Dec 14, 2022 · 6 comments

Comments

@Soundman32
Copy link

Installed product versions

  • Visual Studio: 2022 17.4.2
  • This extension: 1.1.189

Description

Every csproj file gets a local path based RunSettingsFilePath, which ends up getting checked into git and breaks the build.

Steps to recreate

Open solution, build and run tests.

Current behavior

This gets added to every csproj:
<RunSettingsFilePath>C:\dev\MyProjectetc\bin\Debug\net6.0\fine-code-coverage\coverage-tool-output\MyProject.UnitTests-fcc-mscodecoverage-generated.runsettings</RunSettingsFilePath>

Expected behavior

csproj files should not be modified when testing.

@tonyhallett
Copy link
Collaborator

When FCC generates the runsettings it is necessary to write to the proj file. FCC does attempt to remove this element.

It is possible to supply your own runsettings.
Alternatively you can use Coverlet / OpenCover coverage instead of ms code coverage which does not adjust the csproj file.

@Soundman32
Copy link
Author

I'd forgotten I'd enabled the ms code coverage thing. I've turned it off and it now works without updating the csproj.

@tonyhallett
Copy link
Collaborator

There is a difference between ms and 'old style' though. Ms is immediate and collects from the tests you select. Old style runs all tests after the ones you select finish.

I will look at storing the csproj and overwriting with it instead.

@UkeHa
Copy link

UkeHa commented Jul 4, 2023

@tonyhallett, it should use a relative path instead of an absolute one. That way the files can be pushed to git and shared between developers. the autogenerated config should search from the base path of the project with the option to enter an absolute path.

@tonyhallett
Copy link
Collaborator

tonyhallett commented Jul 4, 2023

@UkeHa
The generated runsettings entry in the csproj file should be deleted. If this was occurring then it would be irrelevant. If someone could specify when it doesn't then I could look at it. Note that this does not happen every time.

FCC_removes.mp4

The generated runsettings is generated in your bin folder which is not checked in.

@adamhearn
Copy link

@tonyhallett I can see that for the most part the csproj amendment is removed at the end of the test run.

However, I think there must be an edge case somewhere as it does occasionally get left behind - I've seen this a few times across different projects.

As an aside if a test fails (I just threw an exception in there) the setting is not removed (it did get removed once the test passes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants