vendredi 10 juillet 2020

DeploymentEnabled false is not working in my runsettings file

I currently updated to visual studio 2017 enterprise edition version 15.9.24 . The issue that i'm running across is i'm not able to debug my test using the runsettings file. When I debug the test its access any dlls and deployed files from my TestResults Out folder instead of bin/debug folder since i'm in debug mode. When i was running Visual studio 2015 I was using .testsettings file and was able to run my test from the bin/debug folder. Since .testsettings is going to be deprecated i decided to move to runsettings.

Searching the web and stack someone stated that i needed to have the settings located in the runsettings file that is labeled DeploymentEnabled to false to achieve this. I did this and still getting error because the application is running and trying to access the files from my TestResults Out folder. I also changed the run settings to forced legacy mode to true and added directory of my old test settings file but still not working.

Is there another setting that i'm not taken into consideration or am i missing something or is something wrong with my run settings.
Please see my example of my current runsettings file below Thanks for any help or direction given.

 <?xml version="1.0" encoding="utf-8"?>
<RunSettings>
  <!-- Configurations that affect the Test Framework -->
  <RunConfiguration>
    <MaxCpuCount>1</MaxCpuCount>
    <!-- Path relative to directory that contains .runsettings file
    <ResultsDirectory>.\TestResults</ResultsDirectory> -->

    <!-- x86 or x64 -->
    <!-- You can also change it from the Test menu; choose "Processor Architecture for AnyCPU Projects" -->
    <TargetPlatform>x86</TargetPlatform>

    <!-- Framework35 | [Framework40] | Framework45 -->
    <TargetFrameworkVersion>Framework45</TargetFrameworkVersion>

    <!-- Path to Test Adapters -->
    <!--<TestAdaptersPaths>%SystemDrive%\Temp\foo;%SystemDrive%\Temp\bar</TestAdaptersPaths>-->

    <!-- TestSessionTimeout was introduced in Visual Studio 2017 version 15.5 -->
    <!-- Specify timeout in milliseconds. A valid value should be greater than 0 -->
    <TestSessionTimeout>15000000</TestSessionTimeout>
  </RunConfiguration>

  <!-- Configurations for data collectors -->
  <DataCollectionRunSettings>
    <DataCollectors>
      <DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
        <Configuration>
          <CodeCoverage>
            <ModulePaths>
              <Exclude>
                <ModulePath>.*CPPUnitTestFramework.*</ModulePath>
              </Exclude>
            </ModulePaths>

            <!-- We recommend you do not change the following values: -->
            <UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
            <AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
            <CollectFromChildProcesses>True</CollectFromChildProcesses>
            <CollectAspDotNet>False</CollectAspDotNet>

          </CodeCoverage>
        </Configuration>
      </DataCollector>

    </DataCollectors>
  </DataCollectionRunSettings>

  <!-- Parameters used by tests at run time -->
  <TestRunParameters>
    <Parameter name="webAppUrl" value="http://localhost" />
    <Parameter name="xxxxUser" value="xxxxm,xxxxtAuto01,xxxxtAuto02,xxxxxtAuto03,xxxxtAuto04" />
    <Parameter name="xxxxxxxxxnbr" value="xx86,xx90,xx91,xx92,xx93" />
  </TestRunParameters>

  <!-- MSTest adapter -->
  <MSTest>
    <MapInconclusiveToFailed>true</MapInconclusiveToFailed>
    <CaptureTraceOutput>false</CaptureTraceOutput>
    <DeleteDeploymentDirectoryAfterTestRunIsComplete>true</DeleteDeploymentDirectoryAfterTestRunIsComplete>
    <DeploymentEnabled>false</DeploymentEnabled>
    <!---->
    <ForcedLegacyMode>true</ForcedLegacyMode>
    <SettingsFile>%xxxx_Automation_Test\xxxx_Automation_Test\xxx_Automation_Test\xxxxAutomation.testsettings;</SettingsFile>
    <InProcMode>true</InProcMode>
    <KeepExecutorAliveAfterLegacyRun>False</KeepExecutorAliveAfterLegacyRun>
    <AssemblyResolution>
      <!--
      <Directory path="C:\xxx_Automation\xxxx_Automation_Test\xxx_Automation_Test\bin\" includeSubDirectories="false"/>-->
    </AssemblyResolution>
  </MSTest>

</RunSettings>

Aucun commentaire:

Enregistrer un commentaire