解决IIS发布时global_asax的dll 的CS0433冲突问题

清泛原创
Server Error in '/' Application.
Compilation ErrorDescription: 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\925f9bdc\bb48a68c\App_global.asax.eptr0taj.dll' and 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\925f9bdc\bb48a68c\assembly\dl3\2dbf40e1\195f4379_8b0fd101\App_global.asax.DLL'

Source Error:

Line 176:        protected ASP.global_asax ApplicationInstance {
Line 177:            get {
Line 178:                return ((ASP.global_asax)(this.Context.ApplicationInstance));

Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\925f9bdc\bb48a68c\App_Web_loglist.aspx.e4a91b9d.vm_-rksu.0.cs    Line: 176 


这个错误,折腾了好久,后来发现是发布后,bin 目录下已经有了一个 App_global.asax.dll ,而根目录下的 global.asax 没有删除,结果重复了。

解决方法
删除 global.asax ;
PrecompiledApp.config 文件拷贝到网站根目录下;
问题解决。

IIS CS0433 global_asax 预编译

分享到:
评论加载中,请稍后...
创APP如搭积木 - 创意无限,梦想即时!
回到顶部