H
Hardy Wang
Hi all,
In order to solve code-behind of global.asax problem, I removed the code
from global.asax, and just leave one line "<%@ Application Language="C#"
Inherits="Global"%>" in this file. Then I created a CS file in App_Code
folder named Global.asax.cs:
public class Global : System.Web.HttpApplication {
void Application_OnError(object sender, EventArgs e) {
// my own complex error handling logic
}
}
When I debug locally, it can jump into this function whenever some error
happens.
Then I added a Web Deployment Project to my solution, and merged all DLLs
into one, I copied all my files to web server. BUT when I run the web
server, I got following error
Compiler Error Message: CS0433: The type 'ASP.global_asax' exists in both
'c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\root\0059d51c\80906b1d\App_global.asax.gyayxcqz.dll' and
'c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\root\0059d51c\80906b1d\assembly\dl3\3e64f089\c486205e_fcd1c601\MyWebProject.DLL'
It seems that Web Deployment Project compiles global.asax as well, so that
there are 2 classes named "Global" existing in assemblies.
Who knows what is the solution to solve this problem? I cleared all
temporary files, it doesn't help at all.
I am mad.....
In order to solve code-behind of global.asax problem, I removed the code
from global.asax, and just leave one line "<%@ Application Language="C#"
Inherits="Global"%>" in this file. Then I created a CS file in App_Code
folder named Global.asax.cs:
public class Global : System.Web.HttpApplication {
void Application_OnError(object sender, EventArgs e) {
// my own complex error handling logic
}
}
When I debug locally, it can jump into this function whenever some error
happens.
Then I added a Web Deployment Project to my solution, and merged all DLLs
into one, I copied all my files to web server. BUT when I run the web
server, I got following error
Compiler Error Message: CS0433: The type 'ASP.global_asax' exists in both
'c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\root\0059d51c\80906b1d\App_global.asax.gyayxcqz.dll' and
'c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\root\0059d51c\80906b1d\assembly\dl3\3e64f089\c486205e_fcd1c601\MyWebProject.DLL'
It seems that Web Deployment Project compiles global.asax as well, so that
there are 2 classes named "Global" existing in assemblies.
Who knows what is the solution to solve this problem? I cleared all
temporary files, it doesn't help at all.
I am mad.....