IIS 在处理 LESS 文件时内存不足

IIS runs out of memory while processing LESS files

将 MVC 应用程序部署到生产服务器后,这是我在本地 运行 时看到的错误:

During translation of LESS-code, readed from the file '/Content/bootstrap/bootstrap.less', to CSS-code syntax error has occurred.  See more details:

Error type: Syntax Message: Out of stack space File: /Content/bootstrap/mixins/labels.less

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: BundleTransformer.Core.Translators.AssetTranslationException: During translation of LESS-code, readed from the file '/Content/bootstrap/bootstrap.less', to CSS-code syntax error has occurred.  See more details:

Error type: Syntax
Message: Out of stack space
File: /Content/bootstrap/mixins/labels.less

Source Error:     

Line 6:      <title></title> 
Line 7:      <meta name="description"> content="APPLICATION_NAME" /> 
Line 8:      @Styles.Render("~/bundles/css") 
Line 9:      @Scripts.Render("~/bundles/modernizr") 
Line 10:     <link> rel="stylesheet" href="/Content/CSS/alertify.core.css">

在其他服务器上一切正常。

NOTE: It may be worth mentioning that the server with the problem only has 8GB of RAM and there is another web application and a SQL database running on it. This is my top suspect but I would like other opinions if possible.

我试过添加

BundleTable.EnableOptimizations = false;

App_Start.RegisterBundles class 但这没有区别。

有人建议我将所有 LESS 转换为 CSS,但这是使用标准 Bootstrap,因此需要处理大量文件!

通过为应用程序池启用 32 位应用程序使其工作。

不知道为什么;我不需要为我的开发服务器执行此操作,所以这一定是因为生产服务器的特定配置。

希望对大家有所帮助!