3

我有一个使用较少文件的简单 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,并在 web.config 中添加了 bundletransformer:

<less useNativeMinification="false" ieCompat="true" strictMath="false" strictUnits="false" dumpLineNumbers="None">
      <jsEngine name="V8JsEngine" />
    </less>
4

2 回答 2

1

尝试在服务器上安装Visual Studio 2013 的 Visual C++ Redistributable Packages

注意:旧版本的 JavaScriptEngineSwitcher.V8(版本 1.3.0 之前)需要Visual C++ Redistributable for Visual Studio 2012

于 2015-12-09T09:26:19.673 回答
0

某些版本的 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 安装旧版本的包?

于 2015-07-19T18:41:24.417 回答