Skip to content

MsTest .runsettings .testsettings

Jakub Raczek edited this page Jun 26, 2025 · 9 revisions

MsTest unit tests in Visual Studio can be configured by using a _.runsettings file or _.testsettings. It depends on Visual Studio version you using or test runner version.

Both files should be added as a content to your project during installation of each Ocaramba.MsTest nuget package.

One of solution is to use:

xml version="1.0" encoding="UTF-8"?>
<RunSettings>
	<RunConfiguration>

		<ResultsDirectory>.\ResultsDirectory>
	 RunConfiguration>

  <MSTest>
    <CaptureTraceOutput>falseCaptureTraceOutput>
    <DeleteDeploymentDirectoryAfterTestRunIsComplete>FalseDeleteDeploymentDirectoryAfterTestRunIsComplete>
    <DeploymentEnabled>FalseDeploymentEnabled>

  MSTest>
RunSettings>

RunSettings.runsettings

xml version="1.0" encoding="UTF-8"?>
<RunSettings>
	<RunConfiguration>
    
		<ResultsDirectory>.\ResultsDirectory>
	 RunConfiguration>

  <MSTest>
    <CaptureTraceOutput>falseCaptureTraceOutput>
    <DeleteDeploymentDirectoryAfterTestRunIsComplete>FalseDeleteDeploymentDirectoryAfterTestRunIsComplete>
    <DeploymentEnabled>FalseDeploymentEnabled>
    <SettingsFile>.\Testsettings.testsettingsSettingsFile>
    <ForcedLegacyMode>trueForcedLegacyMode>
  MSTest>
RunSettings>

Testsettings.testsettings

xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Local" id="164f37f6-b408-4a43-9caa-97fe6ccd4dc4" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
  <Description>These are default test settings for a local test run.Description>
  <Deployment enabled="false",
  "2">
	<TestTypeSpecific ,
    name="Execution Agents">
    AgentRule>
  Execution>
TestSettings>

Clone this wiki locally