I have 2 console apps. One in .Net Core 2 and one in .Net 461
I am trying to determine what framework I am running
In the case I am able to identify the the .net core but it is not able to determine it for my .net 461 app
Do I need to add additional information for the .net framework
Here is what I have:
#if NET461
Console.WriteLine("hello from net NET461"); // expecting this to execute, but it does not
#endif
#if NETCOREAPP2_0
Console.WriteLine("hello from net Core");
#endif
#if NETSTANDARD2_0
Console.WriteLine("hello from net NETSTANDARD2_0");
#endif
Update
Although I didn't get the results I wanted\expected. I was really only needed to know if it is running .net core or not. So I just did the following
#if NETCOREAPP2_0
Console.WriteLine("hello from .Net Core");
#else
Console.WriteLine("hello from Not .Net Core");
#endif
Thanks for all the responses