【问题标题】:Parse Error in Global.asax after Publishing to Azure发布到 Azure 后解析 Global.asax 中的错误
【发布时间】:2016-02-08 04:37:16
【问题描述】:

我已将我的 ASP.Net MVC 5 应用程序部署到 Azure Web 应用程序。在我昨天添加 Application Insights 之前,一切都运行良好。从那时起,每次尝试发布我的site 都会导致解析错误。我已经查看了应用程序日志和遥测,但无法辨别事情是如何出错的。是否需要对 global.asax 进行特定更改才能使 Application Insights 正确放置?

更新: 发现web项目属性Assembly Name被意外修改了(菜鸟搬家)。我已经对其进行了更改、清理、重建、发布,但均无济于事。解析错误的输出是:

Parser Error Message: The type 'MobileFirst452.MvcApplication' is ambiguous:   
it could come from assembly 'D:\home\site\wwwroot\bin\licationSeri.DLL' or 
from assembly 'D:\home\site\wwwroot\bin\MobileFirst452.DLL'. Please specify 
the assembly explicitly in the type name.

我从 bin 文件夹中删除了内容。 global.asax的内容如下:

<%@ Application Codebehind="Global.asax.cs" 
Inherits="MobileFirst452.MvcApplication" Language="C#" %>

【问题讨论】:

标签: c# asp.net asp.net-mvc azure azure-web-app-service


【解决方案1】:

发布上述更新后,我查看了部署到 Azure 的文件。我删除了导致错误的 DLL,现在可以完成对站点的测试。智者的话:在发布之前检查项目属性,以防意外输入过多。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-13
    • 1970-01-01
    • 2023-03-24
    • 2020-01-19
    • 2012-07-25
    • 2020-02-13
    • 1970-01-01
    • 2014-05-20
    相关资源
    最近更新 更多