简体   繁体   English

发布到Azure后解析Global.asax中的错误

[英]Parse Error in Global.asax after Publishing to Azure

I have deployed my ASP.Net MVC 5 application to Azure Web Apps. 我已经将ASP.Net MVC 5应用程序部署到Azure Web Apps。 All has worked well until I added Application Insights yesterday. 在昨天我添加了Application Insights之前,一切都运行良好。 Since then, each attempt to publish my site results in a parse error. 从那时起,每次尝试发布我的网站都会导致解析错误。 I've reviewed the application logs and telemetry but cannot discern how things have gone awry. 我已经查看了应用程序日志和遥测,但无法确定情况如何。 Are there specific changes that need to be made to global.asax in order for Application Insights to place well? 为了使Application Insights正确放置,是否需要对global.asax进行特定更改?

Update: I found that the web project properties Assembly Name had been accidentally modified (rookie move). 更新:我发现Web项目属性Assembly Name被意外修改(菜鸟移动)。 I have changed it, cleaned, rebuilt, published all to no avail. 我已经对其进行了更改,清理,重建,发布,但都无济于事。 Output of parse error is: 解析错误的输出为:

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.

I deleted contents from bin folder. 我从bin文件夹中删除了内容。 The contents of global.asax are as follows: global.asax的内容如下:

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

After posting the above update, I reviewed the files deployed to Azure. 发布上述更新后,我检查了部署到Azure的文件。 I deleted the DLL that was causing the error and can now finish testing the site. 我删除了导致错误的DLL,现在可以完成对站点的测试。 Word to the wise: check project properties prior to publishing just in case something was accidentally over-typed. 明智的选择:在发布之前检查项目属性,以防万一某些内容被意外键入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM