Make VSTest ignore TestAdaptersPaths

20 views Asked by At

After updating my solution to .net8 the testrunner fails with "System.InvalidProgramException: Common Language Runtime detected an invalid program."

Trying to figurer out the issue i enable more logging and notice

  <RunConfiguration>
    <TestAdaptersPaths>C:\Program Files (x86)\Progress\Telerik JustMock\Libraries\DataCollectors</TestAdaptersPaths>
    <ResultsDirectory>D:\git\MySolution\TestResults</ResultsDirectory>
    <SolutionDirectory>D:\git\MySolution\</SolutionDirectory>
    <CollectSourceInformation>False</CollectSourceInformation>
  </RunConfiguration>

MySolution has no use for TestAdapters, so as a experiemnt i try to remove the files for the TestAdapters folder. Now the tests runs fine without any issues.

I have other solutions the might use the TestAdapters so deleting them is not the solution. I realise that i can create a .runsettings file

I create a .runsettings in the root of my solution. The file looks like this:

<RunSettings>
  <RunConfiguration>
    <TestAdaptersPaths>.</TestAdaptersPaths>
  </RunConfiguration>
</RunSettings>

When starting the the test the RunConfiguration now looks like this

  <RunConfiguration>
    <TestAdaptersPaths>C:\Program Files (x86)\Progress\Telerik JustMock\Libraries\DataCollectors;.</TestAdaptersPaths>
    <ResultsDirectory>D:\git\MySolution\TestResults</ResultsDirectory>
    <SolutionDirectory>D:\git\MySolution\</SolutionDirectory>
    <CollectSourceInformation>False</CollectSourceInformation>
  </RunConfiguration>

So the path i specify is appended to the TestAdaptersPaths I was hoping to overwrite it. Is there a method to make the test runner ignore the TestAdaptersPath?

0

There are 0 answers