• .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即可。

  • 相关阅读:
    window.clearInterval与window.setInterval的用法
    <a href=“#”>
    DIV+CSS 中的 overflow:hidden
    @media screen
    VS2010程序打包操作--超详细
    Easy CHM使用简明教程
    垃圾纸盒的叠法-超级实用
    IOS 3D UI --- CALayer的transform扩展
    CGContextAddArc
    CGPathAddArc
  • 原文地址:https://www.cnblogs.com/SCscHero/p/15913394.html
Copyright © 2020-2023  润新知