西秀岭

导航

Test Run fails with "An exception occurred while invoking executor 'executor://mstestadapter/v2': Type ... is not marked as serializable."

解决方案:

  • Mark type as Serializable.
  • Don't add the type to CallContext.
  • Set DisableAppDomain value to true in runsettings (supported by MSTest v2, NUnit and XUnit).

       Using a runsettings file User can specify a runsettings file to configure test run. For example:

  • > vstest.console.exe --settings:test.runsettings test.dll
  • > dotnet test -s test.runsettings
  1. Using command line runsettings parameters Various elements of a runsettings file can also specified as command line parameters directly. For example, consider following runsettings:
<RunSettings>
    <RunConfiguration>
        <DisableAppDomain>True</DisableAppDomain>
    </RunConfiguration>
</RunSettings>

posted on 2020-09-18 13:47  西秀岭  阅读(377)  评论(0编辑  收藏  举报