I don't really understand those preprocessor directives what I have to write.
I'm developing a library that should work for many frameworks e.g. .net framework 4.5, 4.6,... and for my application that runs with framework .NETStandard
Version 1.5 -> so I guess this is dnxcore50
?
public class MyClass
{
#if DOTNET5_4
// do nothing
#else
public void MyMethod()
{
Console.WriteLine("framework is supported");
// and do anything with libraries available in the framework :)
}
#endif
}
so this is what I got for now, but MyMethod
is not available with any other framework. Using #if DOTNETCORE50
doesn't work, too.
I also tried to define constraints but my project fails to load when I try this.
Any idea what's the right solution?