gpt4 book ai didi

asp.net - COMPILATION debug=false 正在杀死我的 ASP.NET 站点

转载 作者:行者123 更新时间:2023-12-02 08:07:36 25 4
gpt4 key购买 nike

我有一个大型(对我来说)ASP.NET(4.5 Framework)应用程序,在 VS2012 中开发和发布时运行良好。

我已经从 VS2012 升级到 VS2013,打开解决方案没有出现问题,并且它在本地运行良好(在 IIS Express 上)。

我不知道这是否是转移注意力,但我第一次使用 NuGet 更新 AJAX Control Toolkit(及其依赖项),并且它似乎有效。

当我将网站发布(文件系统发布)到我们的 Web 服务器(Windows Server 2012 中的 IIS 8)时,它会正常加载,直到我更改 <compilation defaultLanguage="vb" debug="true" targetFramework="4.5">debug="false" .
当我这样做时,网站像 pig 一样运行,有时页面甚至无法加载,并且它的 IIS 工作进程使 CPU 达到峰值并保持不变,以百分比的形式增长,直到它基本上耗尽所有 CPU。

编辑:这发生在服务器和我的电脑(IIS Express)上

此测试站点的 AppPool 正在使用与我们实际站点的 AppPool 相同的设置运行。值得注意的是:

  • 启用 32 位应用程序:True
  • .NET 框架版本:v4.0
  • 托管管道模式:集成

我希望您需要更多信息,但老实说,我不知道从哪里开始,而且我不想被不必要的细节淹没。
预先感谢您

编辑:我真的应该提到这一点:
该站点在发布期间以 Release模式进行预编译。过去,在发布之前,我从未在开发环境中更改为 debug=false。

我的解决方案中的每个项目都得到了这个: (0,0): warning : The following assembly has dependencies on a version of the .NET Framework that is higher than the target and might not load correctly during runtime causing a failure: [projectname], Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. The dependencies are: Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. You should either ensure that the dependent assembly is correct for the target framework, or ensure that the target framework you are addressing is that of the dependent assembly.

编辑:看来我继承的这个解决方案是一个网站而不是应用程序。我不知道这是否会发挥作用。

最佳答案

我不再需要为此调用微软。他们使用 ProdDumpLogMan 来分析发生的情况。不到 24 小时,他就回复我说:

"Thread 19 seems to be pretty badly bogging down the CPU. The top of the stack indicates that AjaxMin is trying to do FindEntry on a Dictionary object and this was triggered from AjaxControlToolKit, specifically there appears to be something “CombineScripts” attribute defined on either the Master page or in the design page of OrderDetails.aspx. Basically this combines all the JS files and minifies them.

A quick test would be to disable the logic of CombineScript from AjaxControlToolKit and see if that improves performance"

Google 告诉我 CombineScriptsToolkitScriptManager 的一个属性,并且由于 AJAX 始终是一个可疑的对象(没有真正充分的理由,只是一种预感),所以我立即接受了它。

果然,更改我对 ToolkitScriptManager 的引用以包含 CombineScripts="false" 完全解决了问题!

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" CombineScripts="false" ScriptMode="Release" />

相关帖子:我不是唯一一个:https://www.google.ca/#q=ToolkitScriptManager+combinescripts+problem

两个有用的帖子: http://forums.asp.net/t/1696523.aspx http://ajaxcontroltoolkit.codeplex.com/workitem/27558

关于asp.net - COMPILATION debug=false 正在杀死我的 ASP.NET 站点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20253857/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com