[英]ASP MVC Less file gives: Exception has been thrown by the target of an invocation
我有一個簡單的asp.net mvc 4網站,使用較少的文件。 當我在我的本地電腦上運行它工作正常,但當我將它發布到服務器時,我得到以下錯誤:
During the output text content of processed asset an unknown error has occurred.
See more details:
Exception has been thrown by the target of an invocation.
堆棧跟蹤:
[HttpException (0x80004005): During the output text content of processed asset an unknown error has occurred.
See more details:
Exception has been thrown by the target of an invocation.]
BundleTransformer.Core.HttpHandlers.AssetHandlerBase.ProcessRequest(HttpContextBase context) +1895
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +913
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165
為了渲染較少的文件,我使用了BundleTransformer.Less,並在我在bundletransformer中添加的web.config中:
<less useNativeMinification="false" ieCompat="true" strictMath="false" strictUnits="false" dumpLineNumbers="None">
<jsEngine name="V8JsEngine" />
</less>
嘗試在服務器上安裝Visual Studio 2013的Visual C ++ Redistributable Packages 。
注意:舊版本的JavaScriptEngineSwitcher.V8(版本1.3.0之前)需要Visual C ++ Redistributable for Visual Studio 2012 。
某些版本的JavaScriptEngineSwitcher / BundleTransformer軟件包在IIS 8.5 Web服務器上可能無法正常工作(我不確切知道導致錯誤的原因,可能是某些依賴項,例如ClearScript dll)
在嘗試升級到NuGet上的最新版本並且戰斗決定恢復使用以下版本(在IIS 7 / IIS 8.5上測試並運行良好)之后,我今天遇到了類似的問題:
<package id="BundleTransformer.Core" version="1.9.25" targetFramework="net45" />
<package id="BundleTransformer.Less" version="1.9.25" targetFramework="net45" />
<package id="JavaScriptEngineSwitcher.Core" version="1.2.4" targetFramework="net45" />
<package id="JavaScriptEngineSwitcher.V8" version="1.2.0" targetFramework="net45" />
您可以使用NuGet控制台安裝特定版本的給定軟件包(請參閱如何通過NuGet安裝舊版本的軟件包? )
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.