gpt4 book ai didi

c# - 发布到 Azure 后 Global.asax 中出现解析错误

转载 作者:行者123 更新时间:2023-12-03 03:13:25 26 4
gpt4 key购买 nike

我已将 ASP.Net MVC 5 应用程序部署到 Azure Web Apps。一切都运行良好,直到我昨天添加了 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#" %>

最佳答案

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

关于c# - 发布到 Azure 后 Global.asax 中出现解析错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33576829/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com