I've some problem when using .net standard in .net framework 4.6.2 consoleapps.
I could reduce the problem to this: Given:
I create a .net standard 1.5 client library vis vs 2017 with this single class
public class Class1
{
public List<int> Get()
{
return new List<int>() { 1, 2, 3, 4, 5, 65, 6 };
}
}
Now I create a new .net 4.6.2 console application which is just calling the method of this class:
static void Main(string[] args)
{
var foo = new Class1();
Console.WriteLine("Done!");
Console.ReadLine();
}
Now I get
System.IO.FileNotFoundException: 'The File or Assembly "System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a was not found
When I add the .net standardlib nuget package to the .net fx console it works. but then the system.runtime would be aviable via GAC and via nuget reference which seems to be quite ugly for me.
I pushed this short test solution here: https://github.com/Gentlehag/NetStandardSample
What am I missing?