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

Notification

Icon
Error

Core 2.0 test project not able to read deps
PEtter
#1 Posted : Monday, November 27, 2017 10:23:54 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/29/2012(UTC)
Posts: 4
Location: Norway

Thanks: 1 times
In the start of my test. I have the following

Code:
var path = Process.GetCurrentProcess().MainModule.FileName;



Code:
System.IO.FileNotFoundException : Could not load file or assembly 'System.Collections.NonGeneric, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
   at System.Diagnostics.NtProcessManager.GetModules
   at System.Diagnostics.NtProcessManager.GetFirstModule(Int32 processId)
   at System.Diagnostics.Process.get_MainModule()
   at test.Class1.ConnectToDb() in C:\projects\blitzdb\test\Class1.cs:line 16


Seems nCrunch does not restore nuget packages when it starts to run?

Remco
#2 Posted : Monday, November 27, 2017 10:28:22 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
NCrunch is reliant on Visual Studio restoring Nuget packages for it. In the early stages of integration with .NET Core, NCrunch tried to do this itself, but it only caused chaos.

If you're seeing this consistently after resetting the engine, check to make sure you have a Nuget dependency on System.Collections.NonGeneric from your test project. NCrunch does have a known issue where it has difficulty negotiating some Nuget dependencies that are not referenced directly by the test project.
PEtter
#3 Posted : Monday, November 27, 2017 10:32:19 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/29/2012(UTC)
Posts: 4
Location: Norway

Thanks: 1 times
Seems everything that is not directly referenced by the test project is failing.. hmmmm

The main ref here is the SDK Microsoft.NetCoreApp
PEtter
#4 Posted : Monday, November 27, 2017 10:36:57 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/29/2012(UTC)
Posts: 4
Location: Norway

Thanks: 1 times
Referencing the System.ComponentModel.TypeConverters directly solved the issue for now..
Remco
#5 Posted : Monday, November 27, 2017 10:38:17 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
If this is the same as the known problem, there will be a limited number of Nuget references affected by this.

The root of the issue is that NCrunch still supports .NET Core 1.1, so all of its .NET Core libraries are compiled to this version of the framework. Because the referencing system is different between these two version of .NET Core, this wrecks havoc with the generation of .deps. Introducing Nuget references from the test project for any malfunctioning dependencies effectively resolves the issue.
1 user thanked Remco for this useful post.
PEtter on 11/27/2017(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.033 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download