File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 11
11
using System . Reflection ;
12
12
using System . Runtime . CompilerServices ;
13
13
using System . Runtime . ExceptionServices ;
14
+ using System . Runtime . InteropServices ;
14
15
using System . Runtime . Versioning ;
15
16
using System . Text ;
16
17
using System . Threading ;
@@ -358,6 +359,12 @@ sealed internal class InOutOfProcHelper
358
359
[ ResourceConsumption ( ResourceScope . Process , ResourceScope . Process ) ]
359
360
private InOutOfProcHelper ( )
360
361
{
362
+ if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
363
+ {
364
+ // SafeNativeMethods.GetModuleHandle calls into kernel32.dll, so return early to avoid
365
+ // a System.EntryPointNotFoundException on non-Windows platforms, e.g. Mono.
366
+ return ;
367
+ }
361
368
// Don't need to close this handle...
362
369
// SxS: we use this method to check if we are running inside the SQL Server process. This call should be safe in SxS environment.
363
370
IntPtr handle = SafeNativeMethods . GetModuleHandle ( null ) ;
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ When using NuGet 3.x this package requires at least version 3.4.</description>
35
35
<dependency id =" Microsoft.IdentityModel.Protocols.OpenIdConnect" version =" 6.8.0" />
36
36
<dependency id =" Microsoft.IdentityModel.JsonWebTokens" version =" 6.8.0" />
37
37
<dependency id =" System.Configuration.ConfigurationManager" version =" 4.7.0" exclude =" Compile" />
38
+ <dependency id =" System.Runtime.InteropServices.RuntimeInformation" version =" 4.3.0" />
38
39
</group >
39
40
<group targetFramework =" netcoreapp2.1" >
40
41
<dependency id =" Microsoft.Data.SqlClient.SNI.runtime" version =" 3.0.0" exclude =" Compile" />
You can’t perform that action at this time.
0 commit comments