【发布时间】:2021-06-08 22:45:23
【问题描述】:
我在 .Net core 3.1 中创建了一个 Web 应用程序,并尝试使用 EF Core 访问数据库。 访问它时,我遇到了错误。奇怪的是,它以前可以工作,但在应用程序方面没有任何变化。
at Microsoft.Extensions.Logging.Logger.ThrowLoggingError(List`1 exceptions)
at Microsoft.Extensions.Logging.Logger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
at Microsoft.Extensions.Logging.LoggerMessage.<>c__DisplayClass7_0`3.<Define>g__Log|0(ILogger logger, T1 arg1, T2 arg2, T3 arg3, Exception exception)
at Microsoft.Extensions.Logging.LoggerMessage.<>c__DisplayClass7_0`3.<Define>b__1(ILogger logger, T1 arg1, T2 arg2, T3 arg3, Exception exception)
at Microsoft.EntityFrameworkCore.Diagnostics.EventDefinition`3.Log[TLoggerCategory](IDiagnosticsLogger`1 logger, WarningBehavior warningBehavior, TParam1 arg1, TParam2 arg2, TParam3 arg3, Exception exception)
at Microsoft.EntityFrameworkCore.Diagnostics.CoreLoggerExtensions.QueryIterationFailed(IDiagnosticsLogger`1 diagnostics, Type contextType, Exception exception)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.MoveNext()
at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at System.Linq.SystemCore_EnumerableDebugView`1.get_Items()
【问题讨论】:
-
重启机器能用吗?
-
@mjwills:不再工作了。
-
我有同样的问题,但它是在断电后开始的。
An error occurred while migrating or initializing the database. System.AggregateException: An error occurred while writing to logger(s). (Cannot open log for source '.NET Runtime'. You may not have write access.) ---> System.InvalidOperationException: Cannot open log for source '.NET Runtime'. You may not have write access. ---> System.ComponentModel.Win32Exception (1722): El servidor RPC no está disponible.
标签: c# .net windows asp.net-core logging