Skip to content

[net 6.0] [linux] Microsoft.Data.SqlClient is not supported on this platform #1423

Description

@azuriteemporium

Describe the bug

Deploying a net 6.0 application on Linux trying to connect to a MS SQL server fails with the following exceptions when the 'Portable' runtime is selected during the build/publish step:

image

rkCore.SqlServer:6.0.0' with options: None
Unhandled exception. System.PlatformNotSupportedException: Microsoft.Data.SqlClient is not supported on this platfo
rm.
   at Microsoft.Data.SqlClient.SqlConnectionStringBuilder..ctor(String connectionString)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.<>c.<get_IsMultipleActiveResultS
etsEnabled>b__7_0(String cs)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) in /builddir/bui
ld/BUILD/dotnet-9e8b04bbff820c93c142f99a507a46b976f5c14c/src/runtime.4822e3c3aa77eb82b2fb33c9321f923cf11ddde6/artif
acts/source-build/self/src/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/Concurrent
Dictionary.cs:line 1161
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.get_IsMultipleActiveResultSetsEn
abled()
   at Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerCompiledQueryCacheKeyGenerator.GenerateCacheK
ey(Expression query, Boolean async)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1.GetEnumerator()
   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.System.Collections.Generic.IEnumerable<TEntity>.GetEnu
merator()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) in /builddir/build/BUILD/dotnet-9e8b04bbff8
20c93c142f99a507a46b976f5c14c/src/runtime.4822e3c3aa77eb82b2fb33c9321f923cf11ddde6/artifacts/source-build/self/src/
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/List.cs:line 83
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) in /builddir/build/BUILD/dotnet-9e8b04bbff820c93
c142f99a507a46b976f5c14c/src/runtime.4822e3c3aa77eb82b2fb33c9321f923cf11ddde6/artifacts/source-build/self/src/src/l
ibraries/System.Linq/src/System/Linq/ToCollection.cs:line 29

Further technical details

Microsoft.Data.SqlClient version: 4.0 and 2.0

Linux x64 OS details:

NAME="AlmaLinux"
VERSION="8.5 (Arctic Sphynx)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.5"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.5 (Arctic Sphynx)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:almalinux:almalinux:8::baseos"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8"
ALMALINUX_MANTISBT_PROJECT_VERSION="8.5"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions