我一直在与类似的问题作斗争。对我来说,事实证明我已经为 NLog 启用了内部日志记录。它增加了大约 3 分钟的启动时间!
原始配置
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
throwExceptions="false" throwConfigExceptions="false"
internalLogLevel="Debug"
internalLogFile="C:\Temp\NLog.Internal.txt">
固定配置
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
throwExceptions="false" throwConfigExceptions="false">
对于信息,我通过使用 SysInternals 的 ProcMon.exe 发现了这一点,过滤了进程名称“w3wp.exe”