c# - ASP MVC Less 文件给出 : Exception has been thrown by the target of an invocation

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

我有一个使用较少文件的简单 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>

最佳答案

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

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

关于c# - ASP MVC Less 文件给出 : Exception has been thrown by the target of an invocation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29647337/

相关文章:

javascript - 如何使用 $window.open() 打开部分 View ?

c# - .NET DateTime 到 SqlDateTime 的转换

c# - Entity Framework 如何识别我的 View 模型并绑定(bind)到我的域模型的属性?

c# - Base64 编码对编码有字符串长度限制吗?

c# - 模型或 Controller 中的 Asp.net mvc 下拉代码

c# - 异常 "There is no ViewData item of type ' IEnumerable<SelectListItem>"MVC

jquery - 在 MVC4 中隐藏或显示 DIV

c# - 如何使数据绑定(bind)控件刷新通过反射更改的属性值?

c# - 在 asp.net mvc 6 Entity Framework 7 中获取 session 值 OnConfiguring

regex - 使用正则表达式处理带有 n 个斜杠的 ASP.net 路由