解决The type 'ASP.global_asax' exists in both ASP.global_asax同时存在问题

时间:2025-03-08 17:34:26
  • 习惯发布站点的同学有时候可能遇见以下错误

解决The type 'ASP.global_asax' exists in both ASP.global_asax同时存在问题

  • 这是发布时【预编译勾选/不勾选】产生的文件冲突导致的

解决The type 'ASP.global_asax' exists in both ASP.global_asax同时存在问题

  • 如果不勾选预编译会发布以下代码

解决The type 'ASP.global_asax' exists in both ASP.global_asax同时存在问题

  • 如果勾选预编译会发布以下代码

解决The type 'ASP.global_asax' exists in both ASP.global_asax同时存在问题

错误就在于此,如果非预编译Global.asax会在根目录,如果预编译Flobal.asax会生成dll在bin目录并且在根目录生成PrecompiledApp.config文件,检查一下错误就解决了。