I have some problems when using the .net standard in the .net framework 4.6.2 consoleapps.
I could reduce the problem: Given:
I am creating a .net standard 1.5 vis vs 2017 client library with this single class
public class Class1 { public List<int> Get() { return new List<int>() { 1, 2, 3, 4, 5, 65, 6 }; } }
Now I am creating a new console application .net 4.6.2, which simply calls 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: 'File or assembly' System.Runtime, Version = 4.1.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a not found
When I add the .net standardlib nuget package to the .net fx console, it works. but then system.runtime will be available through the GAC and through the link to nuget, which seems pretty ugly to me.
I clicked here a short test solution: https://github.com/Gentlehag/NetStandardSample
What am I missing?
Boas enkler
source share