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:
- Fitsharp 2022.1.15
- Lextm.SharpSnmpLib 12.4.0
- Microsoft.Data.SqlClient 4.1.0
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.SqlClientto2.0.1. And install theMicrosoft.Data.SqlClient.SNI.Runtime v2.0.1nuget 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.dllpackages\microsoft.data.sqlclient\2.0.1\runtimes\win\lib\netcoreapp3.1\Microsoft.Data.SqlClient.dllA Similar solution was found here for .NET Core 3.1:
Issues for Fitsharp in Github
Naun, answered it on 13th July, but the difference for .NET 6 was to also install the
Microsoft.Data.SqlClient.SNI.Runtime v2.0.1nuget package and copy different versions of the dll's