.Net FW下预编译带来的启动错误

阅文时长| 0.67分钟字数统计| 1080.8字符
主要内容| 1、引言&背景 2、解决方案 3、声明与参考资料
『.Net FW下预编译带来的启动错误』
编写人| SCscHero 编写时间| 2022/2/18 AM11:25
文章类型| 系列完成度| 已完成
座右铭每一个伟大的事业,都有一个微不足道的开始。

一、引言&背景   完成度:100%

a) 应对问题

近日遇到一个部署的问题,如图如详细信息,主要异常错误为:CS0433. The type 'global_asax exists in both 'App_global.asax, Version=0.0.0.0, Culture=neutral, PublicKeyToken=nulrl and ‘App_global.asax nfth-md8, Version=0.0.0.0, Culture=neutral, PublicKey Token=null’。看提示似乎是已经存在了一个.asax文件因此导致的。

Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the fllowing specific error details and modifty your source code appropriately.
Compiler Error Message: CS0433. The type 'global_asax exists in both 'App_global.asax, Version=0.0.0.0, Culture=neutral, PublicKeyToken=nulrl and 'App_global.asax nfth-md8, Version=0.0.0.0, Culture=neutral, PublicKey Token=null'
Source Error:
Line 36:}
Line 37:
Line 38:protected ASP .global_ asax ApplicationInstance {
Line 39:get {
Line 40:return ((ASP.global_asax) (Context.ApplicationInstance));
Source File: C:\WindowslMicrosof.NET\Framework64\v4.0.30319\Temporary ASP.NET Filesrootl2b66bba4\276adbd6)App_Web_concurrntlogin.cshtml.6331810a.ebko3iyw.0.cs Line: 38
Show Detailed Compiler Output:
Show Complete Compilation Source:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3770.0

b) 应用场景

  • .Net Framework开发框架。

二、解决方案   完成度:100%

a) 步骤一:检查预编译文件

可先检查打包后目录,是否生成了两个文件:App_global.asax.compiled和App_global.asax.dll。因此我们要做的是重新生成,按照博主之前删除掉两个预编译文件的思路,貌似是行不通的。

b) 步骤二:取消勾选预编译重新打包

如果是预编译生成的,说明在发布的时候,勾选了"Precompile during publishing Configure"配置。取消掉勾选后,再次发布。

c) 步骤三:部署

重新部署。Restart。

三、声明与参考资料   完成度:100%

原创博文,未经许可请勿转载。

如有帮助,欢迎点赞、收藏、关注。如有问题,请评论留言!如需与博主联系的,直接博客私信SCscHero即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值