发布到 Azure 后 Global.asax 中的解析错误
Parse Error in Global.asax after Publishing to Azure
我已将 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#" %>
发布上述更新后,我查看了部署到 Azure 的文件。我删除了导致错误的 DLL,现在可以完成站点测试了。明智的话:在发布之前检查项目属性,以防意外输入过多。
我已将 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#" %>
发布上述更新后,我查看了部署到 Azure 的文件。我删除了导致错误的 DLL,现在可以完成站点测试了。明智的话:在发布之前检查项目属性,以防意外输入过多。