我正在开发一个 .net 核心控制台应用程序,该应用程序使用 Entity Framework Core 与位于本地的 Linux 的 SQL 服务器交互。
当我运行应用程序时,我收到如下所示的错误。
Process terminated. Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
然后我将环境添加到以下导出
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
Unhandled exception. System.AggregateException: One or more errors occurred. (Globalization Invariant Mode is not supported.)
---> System.NotSupportedException: Globalization Invariant Mode is not supported.
at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at Microsoft.Data.SqlClient.SqlConnection.OpenAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnectionAsync(Boolean errorsExpected, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnectionAsync(Boolean errorsExpected, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
at advance_generics.part.one.Program.CountEmployees(IRepository`1 employeeRepo) in /home/bhaskar/C_Sharp_basics/advance_generics/Program.cs:line 24
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at advance_generics.part.one.Program.Main(String[] args) in /home/bhaskar/C_Sharp_basics/advance_generics/Program.cs:line 15
任何机构都可以帮助我吗?
我对ICU做了以下事情
dpkg --status icu-devtools
Package: icu-devtools
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 678
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: foreign
Source: icu
Version: 66.1-2ubuntu2
Replaces: icu-tools (<< 66.1-1~), libicu-dev (<< 66.1-2ubuntu2)
Depends: libc6 (>= 2.14), libgcc-s1 (>= 3.0), libicu66 (>= 66.1-1~), libstdc++6 (>= 5.2)
Breaks: icu-tools (<< 66.1-1~), libicu-dev (<< 66.1-2ubuntu2)
Description: Development utilities for International Components for Unicode
ICU is a C++ and C library that provides robust and full-featured
Unicode and locale support. This package contains programs used to
manipulate data files found in the ICU sources and is a dependency of
libicu-dev. End users would generally not need to install this package.
Homepage: http://www.icu-project.org
Original-Maintainer: Laszlo Boszormenyi (GCS) <gcs@debian.org>
如果我在 debug 或 Run without debug 模式下运行,则不会遇到问题 我没有收到错误