| 閱文時長 | | 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即可,
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/428418.html
標籤:.NET技术
下一篇:.NET CORE 鑒權
