0

In CI server, I run tests in net4x for both windows and Linux and I want to enable/disable Appdomain based on OS.

In net4x, Xunit tests can be build in both windows and Linux

Getting Started with xUnit.net Multi-targeting with non-Windows OSes

by adding the package

<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">
  <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
</ItemGroup>

dotnet test can run Xunit tests in Linux when MONO is installed.

dotnet test --settings additionalargs.runsettings

The cli command dotnet test use .runsettings to configure tests, but Xunit test configuration are not available.

Is there a way to enable then disable AppDomain in Windows/Linux respectively in dotnet test when running Xunit test project?

something like:

dotnet test --setting appDomain=denied??? # in linux, 
dotnet test --setting appDomain=required??? # in windows
M.Hassan
  • 10,282
  • 5
  • 65
  • 84
  • .NET FW 4.x can work only on Windows. Are you targeting Mon or .NET Core? – Pavel Anikhouski Jun 30 '20 at 12:43
  • Now, net4x can work in Linux with Mono Installed in Linux, see my [ref link](https://xunit.net/docs/getting-started/multi-target/non-windows), and I did in windows 10 and Ubuntu 20.04 using the command `dotnet test` – M.Hassan Jun 30 '20 at 12:47

0 Answers0