Adding some packages for ClosedXML and its dependencies, NCrunch has ceased to work my unit testing project. I get the following error for the project referenced in the test in the NCrunch Tests interface:
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 currently installed and the library is being referenced by your test project. Note that later versions of Xunit do not have support for earlier version of .NET (such as v4.5). You may need to upgrade the version of .NET used by your test project.
I checked all projects and they are all at the same .NET framework version. The version is 4.7.1
I uninstalled and reinstalled XUnit. Here are the packages installed for XUnit:
<package id="xunit" version="2.3.1" targetFramework="net471" />
<package id="xunit.abstractions" version="2.0.1" targetFramework="net471" />
<package id="xunit.analyzers" version="0.8.0" targetFramework="net471" />
<package id="xunit.assert" version="2.3.1" targetFramework="net471" />
<package id="xunit.core" version="2.3.1" targetFramework="net471" />
<package id="xunit.extensibility.core" version="2.3.1" targetFramework="net471" />
<package id="xunit.extensibility.execution" version="2.3.1" targetFramework="net471" />
<package id="xunit.runner.visualstudio" version="2.3.1" targetFramework="net471" developmentDependency="true" />
I have 0 warnings and no errors for the solution. All projects compile. The application runs correctly.
I can see the unit tests in the Visual Studio Test explorer and the tests run.
I am also using ReSharper Ultimate. Its code coverage application can see the tests, runs, and generates results.
I also upgrade NCrunch to the latest version to see if that might resolve the issue, but it did not.
I am at a loss at this point as to why I cannot get NCrunch to work.
Please advise.
Build/Test Issues
Error: An error occurred while analysing this project after it was built
Started by TheNephalim on 5,459 views
Remco NCrunch Developer
#12176
10 May 2018 23:25 UTC
Hi, thanks for sharing this issue.
For NCrunch to build your project, the xunit.execution DLL file needs to be adjacent to your output assembly file. This is typically handled by a build step within Xunit itself.
If you build your project normally, do you see the xunit.execution DLL being placed in your build output directory?
Where others have reported this issue, removing all references to xunit packages and replacing them has usually resolved it.
For NCrunch to build your project, the xunit.execution DLL file needs to be adjacent to your output assembly file. This is typically handled by a build step within Xunit itself.
If you build your project normally, do you see the xunit.execution DLL being placed in your build output directory?
Where others have reported this issue, removing all references to xunit packages and replacing them has usually resolved it.
Thank you for taking the time to respond to my concerns.
I checked the bin folder for my unit testing project and the xunit.execution.desktop.dll file is in the same folder as the output file for the project.
Per my original post, I also uninstalled XUnit and all of its dependencies because of this post - Forum Post
Although this is a drastic move, I think I'm going to create a new unit testing project and install all of the packages from scratch. I have had issues like this before and sometimes, for whatever reason, it becomes the only solution to work.
I will post my findings here.
I checked the bin folder for my unit testing project and the xunit.execution.desktop.dll file is in the same folder as the output file for the project.
Per my original post, I also uninstalled XUnit and all of its dependencies because of this post - Forum Post
Although this is a drastic move, I think I'm going to create a new unit testing project and install all of the packages from scratch. I have had issues like this before and sometimes, for whatever reason, it becomes the only solution to work.
I will post my findings here.
Hello,
I resolved the issue.
For some unknown reason, and I still don't know how this happened, a reference XUnit and some of its dependencies was added to a project within the solution. Once I removed these references, NCrunch began working normally.
Thank you again for your assistance.
I resolved the issue.
For some unknown reason, and I still don't know how this happened, a reference XUnit and some of its dependencies was added to a project within the solution. Once I removed these references, NCrunch began working normally.
Thank you again for your assistance.
Remco NCrunch Developer
#12182
11 May 2018 23:09 UTC
I'm glad you were able to find a solution to this problem. The situation here still remains a mystery to me. I wonder if this could be some kind of cross-version issue between the Xunit components. Thanks for taking the time to share your solution.
Post a reply
Log in to reply.