gpt4 book ai didi

linux - Linux 上不支持 EF Core 平台

转载 作者:行者123 更新时间:2023-12-02 01:49:00 25 4
gpt4 key购买 nike

我正在尝试使用 .NET 6 开发一个小型网络应用程序+ EF Core .到目前为止,我已经能够运行该应用程序,但是当尝试连接到我的 Azure DB 数据库时,它失败并显着抛出 Strings.PlatformNotSupported 异常,如以下堆栈跟踪所示:

System.PlatformNotSupportedException: Strings.PlatformNotSupported_DataSqlClient
at Microsoft.Data.SqlClient.SqlConnectionStringBuilder..ctor(String connectionString)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.<>c.<get_IsMultipleActiveResultSetsEnabled>b__7_0(String cs)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.get_IsMultipleActiveResultSetsEnabled()
at Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerCompiledQueryCacheKeyGenerator.GenerateCacheKey(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 System.Linq.Queryable.First[TSource](IQueryable`1 source)
at Gepro.Seguimiento.Core.Controllers.UsuariosController.Index() in /home/barclow/Documents/Desarrollo/Gepro.Seguimiento.Core/Controllers/UsuariosController.cs:line 24
at lambda_method18(Closure , Object , Object[] )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()

EF Core 与 Linux 兼容吗? - 我记得在 azure 中将这个概念证明部署到 linux docker 并且它有效,但不知何故,我无法让它在我的 manjaro linux 上工作。我知道这不应该是与我安装的 linux 相关的问题,因为我能够完美地运行网络应用程序。

最佳答案

这个问题显然与 .netCore 的 SDK 6.0.100 版本有关,当升级到 SDK 6.0.101 时一切正常。

另外,我有 dotnet 的 AUR 包,所以我不得不删除它,然后使用官方脚本按照 this 进行升级。说明。

curl -sSL https://dot.net/v1/dotnet-install.sh | sudo bash /dev/stdin -c LTS --install-dir /usr/share/dotnet
sudo ln -sf /usr/share/dotnet/dotnet /usr/bin/dotnet

dotnet --list-sdks
# 6.0.101 [/usr/share/dotnet/sdk]

dotnet --list-runtimes
# Microsoft.AspNetCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
# Microsoft.NETCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

关于linux - Linux 上不支持 EF Core 平台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70551339/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com