Closed mgravell closed 5 years ago
(the last 10 were failures to set the UDT type due to hard-coding to SqlParameter
- now fixed, although note: it looks like the TDS stream was hella borked after that had failed)
Update: it also fails on net472
Update: I added a global.json to pin it to sdk 2.2.203 (I have v3 preview as default) - still fails on both net46 and net472, so ... yeah, something is very very unhappy on net4*
Thanks for filing this issue. @mgravell from configuration, which platform are you using? is it x86 or x64?
Almost certainly x64, but can check when at PC
I have replicated this issue while creating a test project for #5 .
System.BadImageFormatException: 'Could not load file or assembly 'Microsoft.Data.SqlClient, Version=1.0.19128.1, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5' or one of its dependencies. An attempt was made to load a program with an incorrect format.'
Target Framework: .Net Framework 4.6.2 Output Type: Console Details: x64 Assembly: Microsoft.Data.SqlClient, Version=1.0.19128.1, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5
I just simply run a very small Console application referencing this Nuget Package.
--> The issue above is not occurring in NetCore 2.1 Console application.
@mikependon the issue is reproducible if I target AnyCPU. I believe it's coming from the same issue noted in https://github.com/dotnet/SqlClient
. Please change your configuration to x64 and see if gets resolved.
@AfsanehR , sorry for the missed. The issue is not happening at x64 (Net Framework 4.6.2), but is happening both AnyCPU and x86 platform. Thanks
This is to be expected until we split the native code out (it's currently a single mixed mode DLL) and change the managed code to load the appropriate native DLL at runtime. We are working on that now and the change is targeted for the next preview.
Hi @mgravell
The latest version of Microsoft.Data.SqlClient splits SNI in a separate Nuget package Microsoft.Data.SqlClient.SNI
Could you give it a try and let us know if issue persists?
Thanks!
Closing as SNI split fixes the issue.
Short version: net46 gives me:
Full repro branch https://github.com/StackExchange/Dapper/commits/ms-sqlclient
I'm using
nuget says this has builds for net46, netstandard2.0 and netcoreapp2.1 so I updated Dapper's tests from
to
(where netcoreapp2.0 should exercise the ns2.0 build)
Now if I use
I get 287 failures, all of the form:
If I use:
then it mostly works, but I get 10 failures that I need to investigate and look "real" but different - will log separately.