Windows10 IIS 上的 ASP.NET Core 应用程序不断崩溃

问题描述 投票:0回答:3

我们正在使用 ASP CORE 运行一个 Web 应用程序。 不幸的是,在检查事件查看器管理器时,我注意到应用程序出现奇怪的崩溃和重新启动。

错误日志如下所示:

故障应用程序名称:dotnet.exe,版本:1.1.0.1179,时间戳:0x58224b03
错误模块名称:KERNELBASE.dll,版本:10.0.14393.1770,时间戳:0x59bf2ba6
异常代码:0xe0434352
故障偏移:0x0000000000033c58
错误进程 ID:0x3ec4
错误的应用程序启动时间:0x01d3885e41a55d69
错误应用程序路径: C:\Program Files\dotnet\dotnet.exe
错误模块路径: C:\Windows\System32\KERNELBASE.dll
报告 ID:20b0cbe4-423e-4adf-ba0f-848a38ea967b
错误包全名:
错误包相关应用程序 ID:

我调查的是dotnet.exe进程的内存泄漏。但这似乎不是问题,因为私有字节参数没有上升。 这里我附上 20 分钟应用程序运行时间的图表。崩溃和重新启动是持续发生的,并且每 2 分钟发生一次。

您对如何调查我的问题有任何想法吗?

c# asp.net iis asp.net-core
3个回答
1
投票

好的,我找到了导致问题的原因。 深入研究应用程序的标准输出日志我注意到:

Unhandled Exception: System.UnauthorizedAccessException: Access to the path 'C:\...\wwwroot\...\...\XYZ-v.json' is denied.
at System.IO.Win32FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)
at System.IO.Win32FileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at XYZ.Utils.Dashboard.DashboardController.SaveToFile()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.TimerQueueTimer.CallCallback()
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.TimerQueue.FireNextTimers()

解决方案是为IIS用户添加对此文件的完全权限。


0
投票

也许,您可以尝试在应用程序池上启用32位应用程序


0
投票

确保 IIS 应用程序池用户对您的应用程序文件夹具有读取和执行权限。 如果您的应用程序正在向文件系统写入某些内容,也请授予它写入权限。

© www.soinside.com 2019 - 2024. All rights reserved.