【问题标题】:MVC5 bundling issue when deploy to Azure service部署到 Azure 服务时的 MVC5 捆绑问题
【发布时间】:2014-10-28 12:13:23
【问题描述】:

我们有一个 MVC5 项目,它有很多脚本文件和样式,我们使用 System.Web.Optimization。

问题是当部署到 azure 时出现如下错误:

Object reference not set to an instance of an object.

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: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 
Line 4:  
Line 5:  @section scripts{
Line 6:      @Scripts.Render("~/bundles/timeApp")
Line 7:      <script>

请注意它在本地机器上正常工作。

我们试图降级“WEBGREASE”但没有成功

谢谢。

【问题讨论】:

标签: asp.net-mvc azure asp.net-bundling


【解决方案1】:

在我遇到此问题的多个实例中,它与 JavaScript 中的错误有关。注释掉所有正在加载和测试的文件,然后一次取消注释部分并重新测试以查看何时重新引入错误,这将导致您找到根本原因。

【讨论】:

    猜你喜欢
    • 2021-08-25
    • 2017-06-24
    • 2022-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-10
    • 1970-01-01
    相关资源
    最近更新 更多