Automatically detect runsettings specified in a build property
See original GitHub issueDescription
The Testwindow in Visual Studio detects a runsettings file specified in the build property RunSettingsFilePath
for a project (c#, f#, and c++), but vstest currently doesn’t mimic this functionality.
Steps to reproduce
- add the following to the .csproj of a test project
<PropertyGroup>
<RunSettingsFilePath>[path to a .runsettings file]</RunSettingsFilePath>
</PropertyGroup>
- run the tests in the project using the cli
Expected behavior
run settings defined in the specified file should be used
Actual behavior
They are currently not applied
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (11 by maintainers)
Top Results From Across the Web
Customizing Code Coverage Analysis - Visual Studio
Starting in Visual Studio 2019 version 16.4, you can autodetect a run settings file in the project root. Otherwise, on the Test menu, ......
Read more >Ability to set runsettings in project file - Developer Community
Specify a project level runsettings file through the build property `RunSettingsFilePath`. Visual Studio will always use the file in test runs ...
Read more >Runsettings file in visual studio code
Go into VS Code's settings and search '.runsettings'. This should show the "Omnisharp: Test Run Setting" setting under the Extensions > C# ...
Read more >Passing parameters to NUnit tests using Azure Pipelines
Under the General section of the Test node, tick the box for “Auto Detect runsettings Files”. Auto Detect runsettings Files in the Options ......
Read more >ReSharper ignoring/reading wrong runsettings file
I am finding that ReSharper is ignoring the runsettings file selected from the VS menu ( Test > Configure Run Settings > Select...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@CodeChief thanks for your response.
The link to the documentation is https://aka.ms/vs-runsettings (https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?branch=release-16.4&view=vs-2019#visual-studio-2019-version-164-and-later specifically) and walks through how to set up auto detection with either with a solution wide “.runsettings” file or one that is specified in the build properties of a project. Please let me know if anything there is unclear and can be improved…
Instead of using
$(ProjectDir)
, we recommend using$(MSBuildProjectDirectory)
(docs). I’ll update the documentation to point users to the recommended list of properties.There is a task in the backlog to expose runsettings better in the VS UI, but it is currently lower in priority.
Closing this issue is fine as it just covers the msbuild property but we should have another tracking issue to enable: