Hello Ron,
Thank you for posting here.
From your description, I understand that you're using the vs 2005 web
deployment project to precompile and deploy your ASP.NET 2.0 Web
application. However, you found that on one target windows 2003 server, the
application's global.asax code never get executed, correct?
Based on my experience, the problem is likely caused by the global.asax
component class is never loaded (and used) on that problem server machine.
When we use webdeployment project to precompile the web application( and
normal project setting configured as "updatable"), the output precompiled
application will not copy the "global.asax" file to the target
application's directory. You can verify this in your appilcation's deployed
directory to see whether the global.asax file is there.
Also, you can use the following code in page to verify whether the
application has loaded the "global.asax" class as the Application Intstance
class:
==========
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("<br/>ApplicationInstance: " +
Context.ApplicationInstance.GetType().FullName);
}
==========
It wil out put something like:
"ApplicationInstance: ASP.global_asax" if the global.asax is loaded,
else if the global.asax is not loaded, it will output
"ApplicationInstance: System.Web.HttpApplication"
I assume it will output the latter. If so, you can check the precompiled
assemblies of that global.asax component. Generally , the global.asax class
will be compiled into the main precompiled assembly(if you use
webdeployment project and choose single output assembly). And in the
private "bin" dir, you can find some "* .compiled" files. These files
are used to map the original file based resource(such as code, page ...) to
their precompiled assemblies. For global.asax, you should be able to find
a file named "App_global.asax.compiled", this class will contains the
information about in which assembly is the "global.asax" class located.
The file's content is as below:
=============App_global.asax.compiled==========
<preserve resultType="8" virtualPath="/IISTestSite/global.asax"
hash="79af1631" filehash="2eea5b7b48d6" flags="150000"
assembly="IISTestSite_deploy" type="ASP.global_asax">
<filedeps>
<filedep name="/IISTestSite/global.asax" />
</filedeps>
</preserve>
==============
this tell the runtime , when it is looking for the "global.asax" file for
the class, it should change to find the class in the
"IISTestSite_deploy.dll" assembly.
So if you didn't find this file or this file's content is corrupted, the
ASP.NET application will faild to load the correct global.asax class.
Hope this helps. If you have anything unclear on this or if there is any
other things I didn't quite get, please feel free to post here.
Regards,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)