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

Notification

Icon
Error

Could not load file or assembly 'xunit.runner.utility.netstandard15, Version=2.2.0.3545, Culture=neu
RonSijm
#1 Posted : Monday, November 6, 2017 10:11:41 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/23/2012(UTC)
Posts: 3
Location: Netherlands

Hi there,

I just installed ncrunch to evaluate if it's suitable for our codebase, but cannot get it to work...
I'm getting the following error:

Code:

An error occurred while analysing this project after it was built: System.IO.FileNotFoundException: Could not load file or assembly 'xunit.runner.utility.netstandard15, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c'. The system cannot find the file specified.
File name: 'xunit.runner.utility.netstandard15, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c'
at nCrunch.Module.XUnit2.Integration.XUnit2DiscoveryEnvironment.<>c__DisplayClass2_0.<FindFrameworkTestsInAssembly>b__1()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Module.XUnit2.Integration.XUnit2DiscoveryEnvironment.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, ComponentUniqueName testComponentUniqueName, PlatformType platformType, DynamicProxy[] dynamicProxies)
at nCrunch.TestExecution.TestFinder.<>c__DisplayClass2_1.<FindTestsForFrameworks>b__1()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.TestExecution.TestFinder.<>c__DisplayClass2_0.<FindTestsForFrameworks>b__0()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.TestExecution.TestFinder.FindTestsForFrameworks(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, DescribedTestFrameworkDiscoverer[] describedDiscoverers, ComponentUniqueName testComponentUniqueName, PlatformType platformType, DynamicProxy[] dynamicProxies)
at nCrunch.TestExecution.RemoteTaskRunner.AnalyseAssembly(DescribedTestFrameworkDiscoverer[] applicableFrameworks, ComponentUniqueName testComponentUniqueName, PerfTracker perfTracker)


I'm not sure why it's looking for xunit.runner.utility.netstandard15, because my test project (and all other projects) are:

Code:

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>


I tried installing more xunit packages, so I have the following packages:

Code:

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.reporters" Version="2.3.1" />
<PackageReference Include="xunit.runner.utility" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />


I tried googling this, but could not find any relevant results...

Any idea what's wrong? I can run my tests perfectly fine through both the Visual Studio Test Explorer, and also through resharper
Remco
#2 Posted : Monday, November 6, 2017 10:42:04 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this problem.

Is there anything in your solution that includes anywhere a reference to xunit.runner.utility? NCrunch packages this binary with its own Xunit integration module. You can find the file that NCrunch should be loading at C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2017\Modules\XUnit2.

It's not clear to me why NCrunch would be trying to use version 15 of the netstandard utility library when searching for tests. It should be using v11. The only reason I can think of is if there is a specific reference to a different version of this binary in your test project's dependency list.

It should not be normal for a test project to reference xunit.runner.utility, as this library is intended only for test runners (like NCrunch) to be able to integrate with Xunit. To my knowledge, this DLL does not contain any code that would be useful for user tests in any form.
RonSijm
#3 Posted : Monday, November 6, 2017 11:19:49 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/23/2012(UTC)
Posts: 3
Location: Netherlands

Hi,

thanks for the quick response.

I did a search in all files, and found some leftover binaries, there was still a folder
\bin\Debug\netcoreapp1.1\project.deps.json which contained this stuff:

Code:

"xunit.runner.reporters/2.2.0": {
"dependencies": {
"xunit.runner.utility": "2.2.0"
},
"runtime": {
"lib/netstandard1.5/xunit.runner.reporters.netstandard15.dll": {}
}


"xunit.runner.utility/2.2.0": {
"dependencies": {
"xunit.abstractions": "2.0.1"
},
"runtime": {
"lib/netstandard1.5/xunit.runner.utility.netstandard15.dll": {}
}
}


I deleted the old bin folders of the tests, rebuild, and did another search, now the results for "xunit.runner.utility" are the following:

Code:

Search "xunit.runner.utility" (47 hits in 7 files)
c:\projects\poc\bin\Debug\netcoreapp2.0\poc.deps.json (6 hits)
    Line 3215: "xunit.runner.utility": "2.3.1"
    Line 3221: "xunit.runner.utility/2.3.1": {
    Line 3227: "lib/netcoreapp1.0/xunit.runner.utility.netcoreapp10.dll": {}
    Line 5321: "xunit.runner.utility/2.3.1": {
    Line 5325: "path": "xunit.runner.utility/2.3.1",
    Line 5326: "hashPath": "xunit.runner.utility.2.3.1.nupkg.sha512"
c:\projects\poc\bin\Debug\netcoreapp2.0\xunit.runner.reporters.netcoreapp10.dll (1 hit)
    Line 900:
c:\projects\poc\bin\Debug\netcoreapp2.0\xunit.runner.utility.netcoreapp10.dll (3 hits)
    Line 4622:    …Ö&™']·']À'Uö'º
    Line 4622:    …Ö&™']·']À'Uö'º
    Line 5049: ¥ „…šÇÀî:
c:\projects\poc\bin\Debug\netcoreapp2.0\xunit.runner.visualstudio.dotnetcore.testadapter.dll (1 hit)
    Line 1794: U
c:\projects\poc\obj\Debug\netcoreapp2.0\poc.csproj.FileListAbsolute.txt (1 hit)
    Line 4: c:\projects\poc\bin\Debug\netcoreapp2.0\xunit.runner.utility.netcoreapp10.dll
c:\projects\poc\obj\Debug\netcoreapp2.0\poc.csprojResolveAssemblyReference.cache (7 hits)
    Line 6:
    Line 6:
    Line 1111: *
    Line 2564:
    Line 2564:
    Line 2564:
    Line 9224: _PublicKey_PublicKeyToken _CultureInfo    _CodeBase_Version_HashAlgorithm_HashAlgorithmForControl_StrongNameKeyPair_VersionCompatibility_Flags_HashForControl
c:\projects\poc\obj\project.assets.json (28 hits)
    Line 4726: "xunit.runner.utility": "[2.3.1]"
    Line 4735: "xunit.runner.utility/2.3.1": {
    Line 4743: "lib/netcoreapp1.0/xunit.runner.utility.netcoreapp10.dll": {}
    Line 4746: "lib/netcoreapp1.0/xunit.runner.utility.netcoreapp10.dll": {}
    Line 12634: "lib/netstandard1.1/xunit.runner.utility.net452.dll",
    Line 12664: "tools/net452/xunit.runner.utility.net452.dll",
    Line 12671: "tools/netcoreapp1.0/xunit.runner.utility.netcoreapp10.dll",
    Line 12672: "tools/netcoreapp1.0/xunit.runner.utility.netcoreapp10.xml",
    Line 12679: "tools/netcoreapp2.0/xunit.runner.utility.netcoreapp10.dll",
    Line 12680: "tools/netcoreapp2.0/xunit.runner.utility.netcoreapp10.xml",
    Line 12698: "xunit.runner.utility/2.3.1": {
    Line 12701: "path": "xunit.runner.utility/2.3.1",
    Line 12703: "lib/net35/xunit.runner.utility.net35.dll",
    Line 12704: "lib/net35/xunit.runner.utility.net35.xml",
    Line 12705: "lib/net452/xunit.runner.utility.net452.dll",
    Line 12706: "lib/net452/xunit.runner.utility.net452.xml",
    Line 12707: "lib/netcoreapp1.0/xunit.runner.utility.netcoreapp10.dll",
    Line 12708: "lib/netcoreapp1.0/xunit.runner.utility.netcoreapp10.xml",
    Line 12709: "lib/netstandard1.1/xunit.runner.utility.netstandard11.dll",
    Line 12710: "lib/netstandard1.1/xunit.runner.utility.netstandard11.xml",
    Line 12711: "lib/netstandard1.5/xunit.runner.utility.netstandard15.dll",
    Line 12712: "lib/netstandard1.5/xunit.runner.utility.netstandard15.xml",
    Line 12713: "xunit.runner.utility.2.3.1.nupkg.sha512",
    Line 12714: "xunit.runner.utility.nuspec"
    Line 12724: "build/_common/xunit.runner.utility.net452.dll",
    Line 12729: "build/netcoreapp1.0/xunit.runner.utility.netcoreapp10.dll",
    Line 12730: "build/netcoreapp1.0/xunit.runner.utility.netcoreapp10.xml",
    Line 12735: "build/uap10.0/xunit.runner.utility.netstandard11.dll",


The problem still remains, the error is still the same as in the first post
Remco
#4 Posted : Monday, November 6, 2017 12:17:24 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
There must be a nuget package dependency from one of your projects to xunit.runner.utility. This is how it's landing in the .deps file. Make sure you remove all nuget dependencies on this library.
RonSijm
#5 Posted : Monday, November 6, 2017 1:36:16 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/23/2012(UTC)
Posts: 3
Location: Netherlands

Does not seem like it.

I've downloaded .NET Dependency Walker to check if any project or reference uses xunit.runner.utility, and it did not...
Remco
#6 Posted : Monday, November 6, 2017 10:55:08 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
After you build your project (just using VS), can you check whether there is a xunit.runner.utility.netstandard15.dll file in your build output directory? This file should be copied there by an xunit build step. If its not there, then there is something wrong with your xunit installation. Removing and replacing the xunit package reference might resolve this.
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