-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix EntryPointNotFoundException in InOutOfProcHelper constructor #1120
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.
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlUtil.cs
Show resolved
Hide resolved
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.EntryPointNotFoundException
when 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.