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

Notification

Icon
Error

.net core 2.0 and refence errors
mhjorth
#1 Posted : Tuesday, March 27, 2018 2:03:02 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/26/2018(UTC)
Posts: 2
Location: Denmark

I am trying to use NCrunch on a .net core 2.0 project but I'm running into som refernce problems.

Currently I'm having problems with this error:

System.IO.FileNotFoundException : Could not load file or assembly 'System.ComponentModel.TypeConverter, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
at ConsoleApp3.Program.TcTest()

This assembly is part of the .net core 2.0 platform and I believe I shouldn't care about referencing it.

What am I doing wrong here?

Michael.

I have this simple console program to demonstrate the problem:

public class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
var tt = TcTest();
Console.WriteLine($"{tt}");
var p = Console.Read();
}

public static string TcTest()
{
var tc = new TypeConverter();
var tt = tc.ConvertToString("string");
return tt;
}
}

And this simple test (NUnit):
public class UnitTest1
{
[Test]
public void TestMethod1()
{
Program.TcTest();
}
}
Remco
#2 Posted : Tuesday, March 27, 2018 10:47:23 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, thanks for sharing this problem.

This problem is in NCrunch's integration with the .NET Core platform. It's a limitation caused by the side-by-side versioning of NCrunch's .NET Core libraries (which are on .NET Core 1.0/1.1) with the .NET Core 2.0 environment.

We've been looking at ways to resolve this, but as the most feasible way seems to be to remove support for .NET Core 1.1 test projects, it's something that may happen much later down the line.

To fix it, just introduce a Nuget reference from your test project to System.ComponentModel.TypeConverter.
mhjorth
#3 Posted : Wednesday, March 28, 2018 6:51:45 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/26/2018(UTC)
Posts: 2
Location: Denmark

Thank you for the reply.

At least there is an explanation.

I can confirm it works by adding the TypeConverter NuGet package to my test project.

Michael.
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.031 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download