Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Error: An error occurred while analysing this project after it was built
TheNephalim
#1 Posted : Thursday, May 10, 2018 6:06:50 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/10/2018(UTC)
Posts: 5
Location: United States of America

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.




Remco
#2 Posted : Thursday, May 10, 2018 11:25:25 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
TheNephalim
#3 Posted : Friday, May 11, 2018 3:12:47 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/10/2018(UTC)
Posts: 5
Location: United States of America

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.
TheNephalim
#4 Posted : Friday, May 11, 2018 7:00:16 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/10/2018(UTC)
Posts: 5
Location: United States of America

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.
Remco
#5 Posted : Friday, May 11, 2018 11:09:11 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.040 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download