Build/Test Issues

xunit v3, missing xunit.v3.runner.inproc.console net6.0?

Started by GreenMoose on 11,849 views

Hi Remco!

I have the same issue.

I've got a testing utils library that got


<PackageReference Include="Verify.XunitV3" Version="29.2.0" />

which has a transient dependency on.

<PackageReference Include="xunit.v3.extensibility.core" Version="2.0.1" />

Basically all projects that include xunit.v3.extensibility.core and are intendent to be util libs are failing.


Even if i mark the testing utils lib with <IsTestProject>false</IsTestProject> NCrunch complains:



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\mgrun\.nuget\packages\xunit.v3.runner.inproc.console\2.0.1\lib\net6.0\xunit.v3.runner.inproc.console.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.

my test projects are multitargeted to net8.0;net9.0

I've tried NCrunch_VS2022_5.13.0.1.msi and NCrunch_VS2022_5.13.0.4.msi

Do you need a small repo?

Regards, Manuel

Edited

As a workaround i currently do:


<!-- TODO: Remove this after NCrunch solved: -->
<PropertyGroup Label="https://forum.ncrunch.net/yaf_postst3559_xunit-v3--missing-xunit-v3-runner-inproc-console-net6-0.aspx">
<OutputType>Exe</OutputType>
<UseApphost>true</UseApphost>
</PropertyGroup>

<!-- TODO: Remove this after NCrunch solved: -->
<ItemGroup Label="https://forum.ncrunch.net/yaf_postst3559_xunit-v3--missing-xunit-v3-runner-inproc-console-net6-0.aspx" >
<PackageReference Include="xunit.v3.core" />
</ItemGroup>

in my util projects.

This works fine in ncrunch and from the command line. I currenlty don't care that the utility libs are outputed as exe's

Hi, you can just turn off the xunit3 adapter for this project in your NCrunch configuration.

Set 'XUnit v3+ Enabled' to False.
Remco wrote:Hi, you can just turn off the xunit3 adapter for this project in your NCrunch configuration.

Set 'XUnit v3+ Enabled' to False.


Thanks! This works but I get a rather missleading warning running the tests in ncrunch, nothing to worry but cosmetic

WARNING - c:\program files\microsoft visual studio\2022\community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets: MSB9008: The referenced project ..\..\src\Vertiq.Testing\Vertiq.Testing.csproj does not exist.

mgrundner wrote:
Thanks! This works but I get a rather missleading warning running the tests in ncrunch, nothing to worry but cosmetic

WARNING - c:\program files\microsoft visual studio\2022\community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets: MSB9008: The referenced project ..\..\src\Vertiq.Testing\Vertiq.Testing.csproj does not exist.


This warning isn't originating from NCrunch. It's something in the build system, probably benign. I would suggest ignoring it.
Remco wrote:
mgrundner wrote:
Thanks! This works but I get a rather missleading warning running the tests in ncrunch, nothing to worry but cosmetic

WARNING - c:\program files\microsoft visual studio\2022\community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets: MSB9008: The referenced project ..\..\src\Vertiq.Testing\Vertiq.Testing.csproj does not exist.


This warning isn't originating from NCrunch. It's something in the build system, probably benign. I would suggest ignoring it.


You are totally right, just rolled back and still got the warning.

Thanks Remco!
The warning is when you reference a project in a directory.build.prop file, it builds fine. switched to normal project references directly in the csproj, then the warning goes away (if somebody gets the same issue)
Hi, today I run into the same problem. The only thing that currently is helping is:


mgrundner wrote:As a workaround i currently do:


<!-- TODO: Remove this after NCrunch solved: -->
<PropertyGroup Label="https://forum.ncrunch.net/yaf_postst3559_xunit-v3--missing-xunit-v3-runner-inproc-console-net6-0.aspx">
<OutputType>Exe</OutputType>
<UseApphost>true</UseApphost>
</PropertyGroup>

<!-- TODO: Remove this after NCrunch solved: -->
<ItemGroup Label="https://forum.ncrunch.net/yaf_postst3559_xunit-v3--missing-xunit-v3-runner-inproc-console-net6-0.aspx" >
<PackageReference Include="xunit.v3.core" />
</ItemGroup>

in my util projects.

This works fine in ncrunch and from the command line. I currenlty don't care that the utility libs are outputed as exe's




Is this still an existing issue?
BTW: I can run all tests with VS Test Explorer.

NCrunch version: 5.15.0.4
Xunit: 2.0.3
xunit.runner.visualstudio: 3.1.1

Edited

As far as I'm aware, any widespread issues of this sort have been resolved in the later builds of NCrunch.

With that said, it's quite possible that certain build configurations can still give dependency errors around Xunit3. Can you share more detail around the project you're experiencing problems with? Does this project contain Xunit tests? Can you copy/paste the error?
This is the error from the UI:

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: D:\.cache\nuget\xunit.v3.runner.inproc.console\2.0.3\lib\net6.0\xunit.v3.runner.inproc.console.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.



I submitted also a Bug Report to you.


I have this issue with two projects (helper libraries). They doesn't contain any unit tests, only some mocks and base classes for our unit tests.
Just to mention: It also helps to include a direct package reference to my two projects..



<ItemGroup>
	<PackageReference Include="xunit.v3.runner.inproc.console" />
</ItemGroup>
I was able to reproduce this in a small repro:

https://github.com/IT-CASADO/ncrunch-issue-01

The problem is related to the following project setting:


<UseArtifactsOutput>true</UseArtifactsOutput>
Thanks for narrowing this down. It looks like this problem is caused by xunit switching to net8, so the path has changed. I'll see about implementing a fix.
Here's a fixed build for you.

NCrunch_Console_5.16.0.3.msi
NCrunch_Console_5.16.0.3.zip
NCrunch_GridNodeServer_5.16.0.3.msi
NCrunch_GridNodeServer_5.16.0.3.zip
NCrunch_LicenseServer_5.16.0.3.zip
NCrunch_Rider_5.16.0.3.7z
NCrunch_Rider_5.16.0.3.zip
NCrunch_VS2010_5.16.0.3.msi
NCrunch_VS2010_5.16.0.3.zip
NCrunch_VS2012_5.16.0.3.msi
NCrunch_VS2012_5.16.0.3.zip
NCrunch_VS2013_5.16.0.3.msi
NCrunch_VS2013_5.16.0.3.zip
NCrunch_VS2015_5.16.0.3.msi
NCrunch_VS2015_5.16.0.3.msi.7z
NCrunch_VS2015_5.16.0.3.zip
NCrunch_VS2017_5.16.0.3.msi
NCrunch_VS2017_5.16.0.3.msi.7z
NCrunch_VS2017_5.16.0.3.zip
NCrunch_VS2019_5.16.0.3.msi
NCrunch_VS2019_5.16.0.3.msi.7z
NCrunch_VS2019_5.16.0.3.zip
NCrunch_VS2022_5.16.0.3.msi
NCrunch_VS2022_5.16.0.3.msi.7z
NCrunch_VS2022_5.16.0.3.zip
I can confirm that your fix is working on my side.

Many thanks for the quick support!

Post a reply

Log in to reply.