4

I have some problems with app.config file in unit tests. It seems that it is ignored by vstest.console.exe. When I run my unit test using MStest, there is no problem with app configuration file.

Configuration file has to resolve some assembly issues (Redirecting Assembly Versions). Here is the content of this file:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="RhinoCommon"
          publicKeyToken="552281e97c755530"
          culture="neutral" />
        <bindingRedirect oldVersion="5.1.30000.4" newVersion="5.1.30000.14"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

When I move this code to machine.config, my unit tests are successfully redirected to use another version of assembly. But this way to solve my assembly issue is unsuitable. The unit test project has to be run on build server, and it is necessary to solve this problem on app level.

In the Internet there are no information about such kind of issue. Based on this answer vstest.console.exe with /EnableCodeCoverage just "hangs"... how debug, and how to fix? the app configuration can be added to vstest.executionengine.config (because this is the exe actually running), but it doesn't work for me, and as I said before this issue should be solved on app level.

With MStest.exe there are no problems with app.config, but it is unsuitable in my situation.

Has anybody seen such issue? Any help would be appreciated.

Community
  • 1
  • 1

0 Answers0