You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Cake 4.0.0. I have a .net framework 48 project, which at the present time has not and probably will not get upgraded to dotnet 8. After upgrading the tests to use xunit 2.9.2 (from xunit 2.8.1), they execute fine in ncrunch/resharper, but not when ran via Cake, because Cake seemingly forces the path to be <fullpath>/tools/xunit.runner.console.2.9.2/tools/net6.0/xunit.console.exe, and xunit complains about xunit.execution.dotnet.dll not being found - they are .net framework 48 tests after all.
After running the Cake script with --verbosity diagnostic and grabbing the command line it calls for xunit, and manually changing it to be <fullpath>/tools/xunit.runner.console.2.9.2/tools/net48/xunit.console.exe, the unit tests ran correctly.
I had a look at the code for the Cake xUnit runner, and at the XUnit2Settings, and if I set UseX86 = true in the Cake script, then Cake runs the unit tests properly.
I guess this is fine as a workaround, but my question really is am I doing the right thing, or is there something else which is 'better' that I can do? I know I could set the ToolPath, but again this seems like a workaround. Just to reiterate, upgrading the project to net8.0 is almost never going to happen. I suppose the only other option would be to downgrade the version of XUnit this project uses back to 2.8.1.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using Cake 4.0.0. I have a .net framework 48 project, which at the present time has not and probably will not get upgraded to dotnet 8. After upgrading the tests to use xunit 2.9.2 (from xunit 2.8.1), they execute fine in ncrunch/resharper, but not when ran via Cake, because Cake seemingly forces the path to be
<fullpath>/tools/xunit.runner.console.2.9.2/tools/net6.0/xunit.console.exe
, and xunit complains aboutxunit.execution.dotnet.dll
not being found - they are .net framework 48 tests after all.After running the Cake script with
--verbosity diagnostic
and grabbing the command line it calls for xunit, and manually changing it to be<fullpath>/tools/xunit.runner.console.2.9.2/tools/net48/xunit.console.exe
, the unit tests ran correctly.I had a look at the code for the Cake xUnit runner, and at the XUnit2Settings, and if I set
UseX86 = true
in the Cake script, then Cake runs the unit tests properly.I guess this is fine as a workaround, but my question really is am I doing the right thing, or is there something else which is 'better' that I can do? I know I could set the ToolPath, but again this seems like a workaround. Just to reiterate, upgrading the project to net8.0 is almost never going to happen. I suppose the only other option would be to downgrade the version of XUnit this project uses back to 2.8.1.
Beta Was this translation helpful? Give feedback.
All reactions