我正在嘗試使用.NET 6 EF Core開發一個小型 Web 應用程式。到目前為止,我已經能夠運行該應用程式,但是當嘗試連接到我的 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 安裝相關的問題,因為我能夠完美地運行 Web 應用程式。
uj5u.com熱心網友回復:
此問題顯然與 .netCore 的 SDK 6.0.100 版本有關,當升級到 SDK 6.0.101 時一切正常。
另外,我有 dotnet 的 AUR 包,所以我不得不將其洗掉,然后按照此說明使用官方腳本進行升級。
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]
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/403468.html
標籤:
上一篇:DVC共享Windows目錄設定
