diff --git a/code/Native/UnixNativeSerial.cs b/code/Native/UnixNativeSerial.cs index 9f79871f..a7ce71c2 100644 --- a/code/Native/UnixNativeSerial.cs +++ b/code/Native/UnixNativeSerial.cs @@ -26,6 +26,7 @@ public UnixNativeSerial() throw new PlatformNotSupportedException("Can't initialise platform library"); } +#if NETSTANDARD15 // On NetStandard 1.5, we must have proper exception handling try { // These methods were first added in libnserial 1.1 @@ -33,6 +34,7 @@ public UnixNativeSerial() } catch (System.EntryPointNotFoundException) { throw new PlatformNotSupportedException("Must have libnserial 1.1.0 or later on .NET Standard 1.5"); } +#endif } private void ThrowException()