Build/Test Issues

Problem with latest xUnit v3 (3.2.0)

Started by Argamon on 1,585 views

While upgrading to latest versions I experienced a problem with the latest xUnit v3 version.

(I am using the latest NCrunch version with VS2022, if it matters)

To reproduce, just create a new Console Application. add a xunit.v3 as dependency and replace the Program.cs with an example test.

When I run this, I get the test results.

After enabling NCrunch I get an error while building:
An error occurred while analysing this project after it was built: Unable to resolve an assembly required for the execution of Xunit3 on this machine.  The assembly was expected at the following path: C:\Users\myuser\.nuget\packages\xunit.v3.core\3.2.0\_content\runners\netcore\xunit.v3.runner.utility.netcore.dll
Please ensure the package containing this assembly is installed on your machine.  If you introduce an assembly reference directly to this binary in your test project, NCrunch will resolve it directly using your specified path.


PS.: After downgrading to xunit v3 3.1.0 it works. So there is definitly a change breaking NCrunch in this latest release
Thanks for letting me know about this. I've reproduced the problem as you've described. It looks like the binary was moved in xunit v3.2 as part of their MTP support changes. I'll see about introducing a fix for this on NCrunch's side. Note that if you reference the xunit assemblies directly, you can by-pass NCrunch's search logic and thereby instruct NCrunch on where to find the files yourself. Or you can just stay on Xunit v3.1 until I can organise a fixed build.
Actually it was meant as a just hint that there is a problem with the latest version. As it was released this Sunday, I do not expect a fix asap ;)

I like to keep my software up to date, but this is not the first time a NuGet package update introduces problems. We will stick to 3.1.0 for now, there is no urge to rush to the new release.

The new way to create constructor arguments looks quite interesting. With the older releases you have to create your own TestFramework and subcluss a hell of xunit classes. But it will take weeks until I have some production ready code.
A fix will be out for this in NCrunch v5.20, which I'm aiming to release with Rider 2025.3, which I'm hoping will be in the coming week.
v5.20 is now available, including a fix to implement support for xunit v3.2.
I had this issue too while doing the net10 migration. The v5.20 fixed it.

Thx

Post a reply

Log in to reply.