IIS Express为每个请求加载和卸载模块 [英] IIS Express loads and unloads modules for each request

查看:89
本文介绍了IIS Express为每个请求加载和卸载模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调试时,我们有一个使用IIS Express的ASP.NET项目.在启动VS2013,然后加载解决方案,构建解决方案并以调试模式启动Web应用程序之后,输出窗口将列出一堆可以加载和卸载的DLL.经过一番搜索,我发现IIS Express会为每个请求重建站点.这是输出窗口的一小部分:

We have an ASP.NET project using IIS Express while debugging. After starting VS2013, then loading the solution, building the solution and starting the web application in debug mode, the output window lists a bunch of DLLs that get loaded and unloaded. After a bit of searching, I discovered that IIS Express rebuilds the site for each request. Here is a small part of the output window:

'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-14-130719418943209850): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Entity\v4.0_4.0.0.0__b77a5c561934e089\System.Web.Entity.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-14-130719418943209850): Loaded 'C:\Users\ca0ssnc\AppData\Local\Temp\Temporary ASP.NET Files\vs\f3da8155\99ebd29d\App_Web_dqpvaqg5.dll'. 
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-14-130719418943209850): Loaded 'C:\Users\ca0ssnc\AppData\Local\Temp\Temporary ASP.NET Files\vs\f3da8155\99ebd29d\App_Web_global.aspx.cdcab7d2.bocgg9o6.dll'. 
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-14-130719418943209850): Loaded 'C:\Users\ca0ssnc\AppData\Local\Temp\Temporary ASP.NET Files\vs\f3da8155\99ebd29d\App_Web_global.aspx.cdcab7d2.kvvdlbnf.dll'. 
'iisexpress.exe' (CLR v4.0.30319: Domain 15): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-14-130719418943209850): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll'
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-14-130719418943209850): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-14-130719418943209850): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'

看到显示 Domain 15 的行吗?那是因为池重新启动了15次!

See the line where it says Domain 15? That's because the pool restarted 15 times!

此外,重要的事实是解决方案源和输出二进制文件都存储在映射的驱动器中.该驱动器位于我们的网络上.

Also, an important fact is that the solution sources and output binaries are all stored in a mapped drive. The drive resides on our network.

现在我已经尝试了所有可以在网上找到的东西:

Now I have tried everything I could find on the net:

  • 删除项目中的所有断点
  • 在本地缓存目录中加载符号(在工具"->选项"->调试"->符号"中)
  • 和其他一些无效的解决方案

在Internet上进行了一些阅读之后,我发现它可能与在应用程序启动时被更改的文件有关,并且IIS Express必须重新编译应用程序才能使更改生效.就是这样,启动应用程序时没有文件被更改.

After a bit of reading on the internet, I found that it may have to do with a file that gets changed when the application starts, and IIS Express must recompile the application to get the changes into effect. But that's the thing, no file gets changed when starting the application.

更多阅读后,我发现当应用程序二进制文件位于网络驱动器上时,启动应用程序时文件的时间戳可能会更改,这会导致IIS Express重新编译应用程序,即使文件内容确实没变.因此,我试图找到解决该问题的方法,有人说断开开发计算机与网络的连接,等待几秒钟,然后重新连接网络!是的,对...

After more reading, I found that when the application binaries reside on a network drive, the time stamp of the files may change when starting the application, which causes IIS Express to recompile the application, even though the contents of the files did not change. So I tried to find a solution for this problem, and a few people said to disconnect the development computer from the network, wait a few seconds and reconnect the network! Yeah, right...

我没有解决方案,所以我尝试了这个遥不可及的解决方案.瞧!有效!!!没有更多的应用程序重新启动!现在,输出窗口如下所示:

I was out of solutions, so I tried this far fetched solution. Lo and behold! It worked!!! No more application restarts! The output window now looks like this:

'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-130719436820489369): Loaded 'C:\Users\ca0ssnc\AppData\Local\Temp\Temporary ASP.NET Files\vs\f3da8155\99ebd29d\App_Web_erxb23tr.dll'. 
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-130719436820489369): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Mobile\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-130719436820489369): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.RegularExpressions\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.RegularExpressions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.RegularExpressions\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.RegularExpressions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-130719436820489369): Loaded 'C:\Users\ca0ssnc\AppData\Local\Temp\Temporary ASP.NET Files\vs\f3da8155\99ebd29d\assembly\dl3\a0da26c9\85d61bc1_9668d001\CalculsWrapper.dll'. Symbols loaded.
'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\ca0ssnc\AppData\Local\Temp\Temporary ASP.NET Files\vs\f3da8155\99ebd29d\assembly\dl3\a0da26c9\85d61bc1_9668d001\CalculsWrapper.DLL'. Symbols loaded.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-130719436820489369): Loaded 'C:\Users\ca0ssnc\AppData\Local\Temp\Temporary ASP.NET Files\vs\f3da8155\99ebd29d\assembly\dl3\95fa9a38\65cf12c4_9668d001\HardLockWrapper.dll'. Symbols loaded.
'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\ca0ssnc\AppData\Local\Temp\Temporary ASP.NET Files\vs\f3da8155\99ebd29d\assembly\dl3\95fa9a38\65cf12c4_9668d001\HardLockWrapper.DLL'. Symbols loaded.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-130719436820489369): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-130719436820489369): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

没有更多的DLL被卸载.该应用程序不再重启(请参见始终使用 DefaultDomain ).现在的问题是,每次重新启动VS2013时,都会再次出现此问题.每次重新启动VS2013时,都必须断开连接并重新连接网络连接.

No more DLLs that gets unloaded. The application does not get restarted anymore (see that DefaultDomain is always used). Now the problem is that this issue reappears every time I restart VS2013. Each time I restart VS2013, I have to disconnect and reconnect my network connection.

另外,另一个重要的事实:我将Web Essentials用于Visual Studio 2013 Update4.禁用此扩展名后,没有更多问题了!该应用程序不会重新启动,并且我不需要断开网络连接.因此问题可能出在此扩展程序上.

Also, another important fact: I use Web Essentials for Visual Studio 2013 Update 4. When I disable this extension, no more problem! The application does not gets restarted and I do not need to disconnect my network. So the problem is probably coming from this extension.

现在有人可以告诉我,断开网络连接,Web Essentials以及出于任何原因更改Web应用程序文件的时间戳之间的关系是什么?

Now can someone please tell me what in the world is the relationship between me disconnecting my network connection, Web Essentials, and the time stamps of the web application files being changed for whatever the reason??

推荐答案

确保您正在从本地驱动器运行该解决方案.

Make sure you're running the solution from a local drive.

我遇到了同样的问题.每个请求的执行速度都很慢,甚至只是返回一个代码200的结果,或加载收藏夹图标.

I experienced the same issue. Every request was really slow, even just returning a code 200 result, or loading the favicon.

输出窗口显示出与OP描述类似的症状.

The output window showed similar symptoms to that described by the OP.

我正在从映射的驱动器上运行我的解决方案(即使该映射指向本地驱动器).

I was running my solution from a mapped drive (even though the map was pointing to a local drive).

从本地驱动器运行它可以直接解决该问题.感谢@SimonSenécal对其他答案的评论,这为我指明了正确的方向.

Running it from the local drive directly cured the problem. Thanks to the comment from @Simon Senécal on the other answer which pointed me in the right direction.

这篇关于IIS Express为每个请求加载和卸载模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆