使用IIS配置本地站点,然后编译项目完成后,浏览器加载页面变得非常慢,之前虽然会慢一些,但加载时最多可能需要1到2分钟(可能包含一些预编译)加载dll文件),但现在变得非常慢,第一次需要6到7分钟才能加载。
我使用'Fusion Log Viewer'来查看程序集绑定日志加载,发现一些dll需要很长时间。
请注意,下图显示了页面加载程序集: assembly loding image
我参考了这个链接:
http://blog.lavablast.com/post/2010/12/01/Slash-your-ASPNET-compileload-time.aspx
然后我设置了文件“C:\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Config \ web.config” 配置节点:
<Compilation batch = "false" optimizeCompilations = "true">
但效果并不明显,而访问某些用户控件的时间仍然很慢。
这里我选择了一个相对较慢的dll加载日志,希望有人知道因为什么这么慢,帮助分析。
Assembly Binder Log Entry (7/7/2016 @ 8:02:27 PM)
The operation was successful.
Bind result: hr =0x0. The operation completed successfully.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = QUOTIT\webuser
LOG: Where-ref bind. Location = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\quotit_apps_ipro\4dcf303f\bb9a0eb4\App_Web_mev5nz2h.dll
LOG: Appbase = file:///C:/TFS/Sprints/Sprint/src/Quotit2010.root/Quotit/Webs/Ipro/
LOG: Initial PrivatePath = C:\TFS\Sprints\Sprint\src\Quotit2010.root\Quotit\Webs\Ipro\bin
LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\quotit_apps_ipro\4dcf303f
LOG: Cache Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\quotit_apps_ipro\4dcf303f
LOG: AppName = bb9a0eb4
Calling assembly : (Unknown).
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\TFS\Sprints\Sprint\src\Quotit2010.root\Quotit\Webs\Ipro\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/quotit_apps_ipro/4dcf303f/bb9a0eb4/App_Web_mev5nz2h.dll.
LOG: Assembly download was successful. Attempting setup of file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\quotit_apps_ipro\4dcf303f\bb9a0eb4\App_Web_mev5nz2h.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: App_Web_mev5nz2h, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
LOG: Re-apply policy for where-ref bind.
LOG: Where-ref bind Codebase matches what is found in default context. Keep the result in default context.
LOG: The post-policy assembly reference requires probing again.
LOG: Switch from LoadFrom context to default context.
LOG: Using application configuration file: C:\TFS\Sprints\Sprint\src\Quotit2010.root\Quotit\Webs\Ipro\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/quotit_apps_ipro/4dcf303f/bb9a0eb4/App_Web_mev5nz2h.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\quotit_apps_ipro\4dcf303f\bb9a0eb4\App_Web_mev5nz2h.dll
LOG: Entering run-from-source setup phase.
LOG: Binding succeeds. Returns assembly from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\quotit_apps_ipro\4dcf303f\bb9a0eb4\App_Web_mev5nz2h.dll.
LOG: Assembly is loaded in default load context.
事实上,我一直在想为什么会出现这个问题,而且我从来没有讨论过IIS配置