關於錯誤 Compiler Error Message: CS0433: The type 'ASP.global_asax' exists in both 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET

2023-06-16

最近在移植一些專案遇到這個問題

Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0433: The type 'ASP.global_asax' exists in both 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\64203716\99481ad\App_global.asax.lldgsdpc.dll' and 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\64203716\99481ad\assembly\dl3\1fdcbdce\1ebebc9e_08a0d901\App_global.asax.DLL'


真的卡了一下,畢竟很少遇到,後來才發現在 bin  資料夾中 多了一些東西

App_global.asax.compiled ,App_global.asax.dll 


後來經過查詢原來是我在發佈得時候手賤勾選了 "在發佈期間先行編譯"

這個不要勾選,之後編譯出來就不會有了,接下來把機器上面的 bin 那兩個檔案 App_global.asax.compiled ,App_global.asax.dll  刪掉就沒事了

害我花了一點時間找問題,因為第一次碰到


reference:

https://blog.darkthread.net/blog/aspnet-mvc-precompiledapp/

https://stackoverflow.com/questions/20852039/compilation-error-the-type-asp-global-asax-exists-in-both-dlls





當麻許的超技八 2014 | Donma Hsu Design.