Build/Test Issues

Unable to run NCrunch 3.9.0.1 with XUnit 2.1

Started by jfiuza on 6,114 views

Hello, I'm facing this problem since I've updated.

An error occurred while analysing this project after it was built: NCrunch: Xunit reported a problem when trying to find its runtime execution library (xunit.execution.*). This library is required to discover and execute tests. Please make sure you have xunit correctly installed and the library is being referenced by your test project. Note that later versions of Xunit do not have support for earlier versions of .NET (such as v4.5). You may need to upgrade the version of .NET used by your test project.

Now I've been using XUnit 2.1 so no change on that part

<packages>
<package id="Autofac" version="3.5.2" targetFramework="net45" />
<package id="AutoFixture" version="3.34.2" targetFramework="net45" />
<package id="AutoFixture.AutoMoq" version="3.34.2" targetFramework="net45" />
<package id="AutoFixture.Xunit2" version="3.34.2" targetFramework="net45" />
<package id="FluentAssertions" version="4.0.0" targetFramework="net45" />
<package id="Ix-Main" version="1.2.5" targetFramework="net45" />
<package id="JetBrains.Annotations" version="9.1.1" targetFramework="net45" />
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
<package id="NCrunch.Framework" version="2.20.0.4" targetFramework="net45" />
<package id="Rx-Core" version="2.2.4" targetFramework="net45" />
<package id="Rx-Interfaces" version="2.2.4" targetFramework="net45" />
<package id="Rx-Linq" version="2.2.4" targetFramework="net45" />
<package id="Rx-Main" version="2.2.4" targetFramework="net45" />
<package id="Rx-PlatformServices" version="2.2.4" targetFramework="net45" />
<package id="Rx-Testing" version="2.2.4" targetFramework="net45" />
<package id="xunit" version="2.1.0" targetFramework="net45" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
<package id="xunit.assert" version="2.1.0" targetFramework="net45" />
<package id="xunit.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" />
</packages>



Could you please advise?

Many thanks,
Joao
Hi,

v3.9 of NCrunch changed the xunit integration, so instead of packaging xunit runtime assemblies (namely xunit.execution.*) with NCrunch, it now calls into xunit and lets xunit itself find these assemblies. Considering the search code and the handling of xunit.execution is inside xunit itself, it's my expectation that your current setup also won't work on any other xunit compatible test runner.

The root of the problem is that the xunit.execution DLL does not exist in the build output directory of your test project. It's quite possible that uninstalling and reinstalling the xunit nuget package will solve this problem.

Post a reply

Log in to reply.