Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Threading;
Expand Down Expand Up @@ -358,6 +359,12 @@ sealed internal class InOutOfProcHelper
[ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]
private InOutOfProcHelper()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
// SafeNativeMethods.GetModuleHandle calls into kernel32.dll, so return early to avoid
// a System.EntryPointNotFoundException on non-Windows platforms, e.g. Mono.
return;
}
// Don't need to close this handle...
// SxS: we use this method to check if we are running inside the SQL Server process. This call should be safe in SxS environment.
IntPtr handle = SafeNativeMethods.GetModuleHandle(null);
Expand Down