写入记录器时发生错误。 (无法打开源“.NET Runtime”的日志。您可能没有写入权限。)

2023-11-29

我在 .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()

尝试启动 Windows 事件日志服务器在此输入图像描述

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

写入记录器时发生错误。 (无法打开源“.NET Runtime”的日志。您可能没有写入权限。) 的相关文章

随机推荐