IIS处理LESS文件时内存不足

时间:2016-03-03 13:13:39

标签: asp.net-mvc-5 less iis-8

将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">

这一切在其他服务器上都能正常工作。

  

注意:可能值得一提的是服务器只有问题   有8GB的RAM,还有另一个Web应用程序和一个SQL数据库   在它上面跑。这是我的头号嫌疑人,但我想要其他意见   如果可能的话。

我尝试过添加

BundleTable.EnableOptimizations = false;

App_Start.RegisterBundles班级,但没有区别。

有人建议我将所有LESS转换为CSS,但这是使用标准的Bootstrap,所以有很多文件要经过!

1 个答案:

答案 0 :(得分:1)

通过为应用程序池启用32位应用程序来实现它。

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

希望它能帮到某人!