Closed
Description
Scripts are a common and everyday way to work F# and forms part of the standard development lifecycle. I can't figure out how to use the SqlClient library from within an F# script:
- Download the nuget package.
- Try referencing the netstandard version of the library e.g.
#r @"C:\Users\Isaac\.nuget\packages\microsoft.data.sqlclient\1.0.19269.1\lib\netstandard2.0\Microsoft.Data.SqlClient.dll
. - Script will crash when you try to open a connection with a
PlatformNotSupported
exception. - After looking around for a while, read this link.
- Try to reference the net46 version of the library:
#r @"C:\Users\Isaac\.nuget\packages\microsoft.data.sqlclient\1.0.19269.1\lib\net46\Microsoft.Data.SqlClient.dll"
- Get another exception:
System.TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.SNINativeMethodWrapper' threw an exception. ---> System.ComponentModel.Win32Exception: Failed to load C:\Users\Isaac\.nuget\packages\microsoft.data.sqlclient\1.0.19269.1\lib\net46\x64\SNI.dll
at Microsoft.Data.SqlClient.SNINativeMethodWrapper..cctor() in E:\agent1\_work\34\s\src\Microsoft.Data.SqlClient\netfx\src\Microsoft\Data\Interop\SNINativeMethodWrapper.cs:line 66
I can't find any SNI.dll
within the nuget package. How can I get this to work?
Also - why include a netstandard2.0 TFM in the package, if netstandard2.0 is, effectively, not supported? This is misleading and very tightly couples the package to NuGet.