I am trying to port several libraries from .NET Framework 4.0 to .NET Core, and saw that one of the useful things you can do is add things like the following that will conditionally compile portions of your code:
#if NETCOREAPP1_0
do something
#elif NET40
do something else
#endif
My question is what to put in place of the NET40
in the code above. I have only been able to get NETCOREAPP1_0
and NETSTANDARD1_6
to be recognized. Every other thing I've put in for the NET40
hasn't worked, including net40
, NET40
, NET4_0
, and a few others. Is there a list somewhere that would give guidance on how to reference it? Or is there additional steps I need to take in another portion of the project to get it to recognize net40
?
Try using DNX40. Something along the lines of
#if NETCOREAPP1_0
do something
#elif DNX40
do something else
#endif
This is taken from asp.net though, from this video: https://channel9.msdn.com/Events/dotnetConf/2015/ASPNET-5-Deep-Dive around the 36 minute mark. Usually the .net stuff works for the full framework.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With