using System.Collections.Generic;
static void Bar<T>(IEnumerable<T> value)
{ Console.WriteLine("static void Bar<T>(IEnumerable<T> value) called."); }
static void Bar<T>(T source)
{Console.WriteLine("static void Bar<T>(T source) called."); }
public static void Test()
var value = new FooImpl[0];
public static void Main()
Console.WriteLine("Environment version: {0} ({1})", System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription , GetNetVersion());
Console.WriteLine("Failed with unhandled exception: ");
public static string GetNetVersion()
var assembly = typeof(System.Runtime.GCSettings).GetTypeInfo().Assembly;
var assemblyPath = assembly.Location.Split(new[] { '/', '\\' }, StringSplitOptions.RemoveEmptyEntries);
int netCoreAppIndex = Array.IndexOf(assemblyPath, "Microsoft.NETCore.App");
if (netCoreAppIndex > 0 && netCoreAppIndex < assemblyPath.Length - 2)
return assemblyPath[netCoreAppIndex + 1];