Fix EntryPointNotFoundException in InOutOfProcHelper constructor#1120
Conversation
The constructor of InOutOfProcHelper would throw a `System.EntryPointNotFoundException` when running on a non-Windows platform such as Mono on Linux or macOS: ``` GetModuleHandle assembly:<unknown assembly> type:<unknown type> member:(null) at (wrapper managed-to-native) Microsoft.Data.Common.SafeNativeMethods.GetModuleHandle(string) at Microsoft.Data.SqlClient.InOutOfProcHelper..ctor () [0x00006] in <de6019a43b5544ecb987a2a77d294ad3>:0 at Microsoft.Data.SqlClient.InOutOfProcHelper..cctor () [0x00000] in <de6019a43b5544ecb987a2a77d294ad3>:0 ``` We avoid the EntryPointNotFoundException by returning early on non-Windows platforms where the module can't be inside the SQL Server process anyway.
|
Is there a way to reproduce the issue you mentioned on Windows? |
|
Well, you can't reproduce this issue on Windows since And here's the failure that you should get: |
|
I'm still a little worried about running |
|
I don't think it's an issue honestly. If it were, compilation would fail. I think the docs may be wrong. I will check if we need to include it in nuspec for ensuring it's availability, it shouldn't hurt. |
…eAwait calls (Backport dotnet#1120)
…eAwait calls (Backport dotnet#1120)
|
I deleted my comment and reposted it in an open issue rather than in a merged pull request: #1263 (comment) |

The constructor of InOutOfProcHelper would throw a
System.EntryPointNotFoundExceptionwhen running on a non-Windows platform such as Mono on Linux or macOS:We avoid the EntryPointNotFoundException by returning early on non-Windows platforms where the module can't be inside the SQL Server process anyway.