【问题标题】:ASP MVC Less file gives: Exception has been thrown by the target of an invocationASP MVC Less 文件给出:异常已被调用的目标抛出
【发布时间】:2015-04-15 10:05:25
【问题描述】:

我有一个使用较少文件的简单 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 中 在捆绑变压器中:

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

【问题讨论】:

  • 有内部异常吗?该错误通常意味着“我调用的某个组件引发了异常”,您需要知道那个异常是什么。
  • 没有内部异常
  • 您使用的是什么版本的 JavaScriptEngineSwitcher 包?

标签: c# asp.net-mvc asp.net-mvc-4 less bundletransformer


【解决方案1】:

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

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

【讨论】:

  • 我尝试在 2008-2015 年安装所有可再发行包的情况下在本地(本地 iis / express)运行,但它没有按预期工作。我最终陷入了同样的境地。具有以下配置:
  • 这种情况下,需要的正是2013版本,2015版本不会替代。
  • 我尝试安装以下可再发行软件包imgur.com/e8xEZo0,但仍然无法摆脱错误
  • 你使用什么版本的 ASP.NET?
  • 4.5.2.但看起来它与机器相关,而不是与项目相关。 90% 从事这个项目的人没有任何问题。我们尝试切换到 MSIE,一切都 100% 好。
【解决方案2】:

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 控制台安装给定软件包的特定版本(请参阅 How to install an older version of package via NuGet?)

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-10-08
  • 1970-01-01
相关资源
最近更新 更多