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

Notification

Icon
Error

Wrong assembly version copied to _ncrunchreferences
mc-clasoft
#1 Posted : Monday, September 17, 2018 7:13:49 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/12/2017(UTC)
Posts: 3

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Hi,

I've been using NCrunch quite a while in a project based on .NET 4.6.2 using MongoDB 2.4.4, compiled with Visual Studio 2017. After upgrading the project to .NET 4.7, NCrunch (3.20) started copying the wrong version of System.Runtime.InteropServices.RuntimeInformation.dll to _ncrunchreferences. Visual Studio shows the path "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net47\lib\System.Runtime.InteropServices.RuntimeInformation.dll", with version 4.0.2. The respective assemblybinding setting in the app.config redirects to 4.0.2. This works fine for the xunit console test-runner and the ReSharper runner, but when using NCrunch to run the tests, the MongoDB internals throw a FileNotFoundException for version 4.0.0. NCrunch apparently found 4.0.0, copied it to _ncrunchreferences, but MongoDB only seems to accept 4.0.2 (probably due to the redirect to 4.0.2 introduced by the upgrade to .NET 4.7). I guess that NCrunch uses the assembly from the System.Runtime.InteropServices.RuntimeInformation Nuget package, which is 4.0.0, even though Visual Studio shows a different path in the reference properties of that assembly.

Now I enabled "Copy referenced assemblies to workspace", which apparently solves the problem. But it seems very strange, and NCrunch explicitly warns about the performance implications of this setting. How can I force NCrunch to avoid the assembly from the Nuget package? I can't uninstall it, because it's a dependency of MongoDB. It just should be ignored, just like Visual Studio does.

Best regards,
Malte
Remco
#2 Posted : Monday, September 17, 2018 11:04:40 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,974

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Hi Malte,

Thanks for sharing this issue.

With VS15.8, MS introduced an assembly referencing redirection hack that affected some versions of .NET. This has caused a chain of issues for us, as it means that projects now need to be built with one version of assembly while referencing a different one at run time.

NCrunch v3.19/v3.20 introduced a fix in this area, but there still seems to be a scenario that it doesn't address. We've been desperately trying to get hold of a sample solution that can produce the problem for us so that we can fix it. Is there any chance you can isolate this in a sample that you can share with us? You can submit small code ZIPs through the NCrunch contact form.
Remco
#3 Posted : Friday, September 28, 2018 6:15:07 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,974

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
1 user thanked Remco for this useful post.
mc-clasoft on 9/29/2018(UTC)
mc-clasoft
#4 Posted : Saturday, September 29, 2018 11:34:25 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/12/2017(UTC)
Posts: 3

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Thanks Remco, this solved the problem.
1 user thanked mc-clasoft for this useful post.
Remco on 9/29/2018(UTC)
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.043 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download