When creating a new .net 6 project with Microsoft.Data.SqlClient It works fine. But When running through a .net 6 fitnesse project with fitsharp we are getting this error:
System.PlatformNotSupportedException: Microsoft.Data.SqlClient is not supported on this platform
Dependancies:
I've tried adding <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
to .csproj
That bypassed some errors, But the PlatformNotSupportedExcpetion
is still present.
When converting to a console app and running from program. It works fine. But it won't work when running through fitnesse with fitsharp
The work around for now was to downgrade Microsoft.Data.SqlClient
to 2.0.1
. And install the Microsoft.Data.SqlClient.SNI.Runtime v2.0.1
nuget package. Having <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
was needed, but this didn't copy the Microsoft.Data dll's to bin on build. So These two dll's needed to be move to bin:
packages\microsoft.data.sqlclient.sni.runtime\2.0.1\runtimes\win-x64\native\Microsoft.Data.SqlClient.SNI.dll
packages\microsoft.data.sqlclient\2.0.1\runtimes\win\lib\netcoreapp3.1\Microsoft.Data.SqlClient.dll
A Similar solution was found here for .NET Core 3.1:
Naun, answered it on 13th July, but the difference for .NET 6 was to also install the Microsoft.Data.SqlClient.SNI.Runtime v2.0.1
nuget package and copy different versions of the dll's