473,545 Members | 289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web Deployment Projects global.asax problem

Ron
I have a web project compiled with the new "Web Deployment Projects" plugin
for VS2005.
I'm deploying the web project to one assembly and with updateable option set
to ON.
When I'm running the generated code on a W2K3 server the application_sta rt
and any other event on the global.asax file won't fire. I added tracing and
logging to make sure and I can see the code is just not execution. When
running the same exact (deployed etc.) code on an XP Pro machine everything
just works and the events are firing.
If I test the original project (non compiled with source .vb files and
everything) on the W2K3 machine, it also works fine. So it seems to be
something that is changing in the compilation that affects the W2K3 server
but not the XP platform.

Please help.

Thanks,
Ron
Jun 15 '06 #1
11 8331
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.asa x" 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.asa x" class as the Application Intstance
class:

==========
protected void Page_Load(objec t sender, EventArgs e)
{
Response.Write( "<br/>ApplicationIns tance: " +
Context.Applica tionInstance.Ge tType().FullNam e);
}
==========
It wil out put something like:

"ApplicationIns tance: ASP.global_asax " if the global.asax is loaded,

else if the global.asax is not loaded, it will output

"ApplicationIns tance: System.Web.Http Application"

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.asa x.compiled", this class will contains the
information about in which assembly is the "global.asa x" class located.
The file's content is as below:

=============Ap p_global.asax.c ompiled======== ==

<preserve resultType="8" virtualPath="/IISTestSite/global.asax"
hash="79af1631" filehash="2eea5 b7b48d6" flags="150000"
assembly="IISTe stSite_deploy" type="ASP.globa l_asax">
<filedeps>
<filedep name="/IISTestSite/global.asax" />
</filedeps>
</preserve>
==============

this tell the runtime , when it is looking for the "global.asa x" file for
the class, it should change to find the class in the
"IISTestSite_de ploy.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.)
Jun 16 '06 #2
Ron
Hi Steven,

Thanks for the info. I still have a problem.
The global.asax file is not copied to the target directory. Copying it
manually did not solve the problem.
I checked the "App_global.asa x.compiled" file and it looked good and pointed
to the right assembly.

Again I would like to stress that the deployed web application works
perfectly on an XP Pro system. Copying the same set of files to the 2003
server gives us the errors I mentioned on the previous message.

Is there anything else we can check? Should there be a difference if the
compilation is done on an XP machine or on the target 2003 server?

Thanks,
Ron
"Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
news:gn******** ******@TK2MSFTN GXA01.phx.gbl.. .
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.asa x" 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.asa x" class as the Application Intstance class:

==========
protected void Page_Load(objec t sender, EventArgs e)
{
Response.Write( "<br/>ApplicationIns tance: " +
Context.Applica tionInstance.Ge tType().FullNam e);
}
==========
It wil out put something like:

"ApplicationIns tance: ASP.global_asax " if the global.asax is loaded,

else if the global.asax is not loaded, it will output

"ApplicationIns tance: System.Web.Http Application"

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.asa x.compiled", this class will contains the
information about in which assembly is the "global.asa x" class located.
The file's content is as below:

=============Ap p_global.asax.c ompiled======== ==

<preserve resultType="8" virtualPath="/IISTestSite/global.asax"
hash="79af1631" filehash="2eea5 b7b48d6" flags="150000"
assembly="IISTe stSite_deploy" type="ASP.globa l_asax">
<filedeps>
<filedep name="/IISTestSite/global.asax" />
</filedeps>
</preserve>
==============

this tell the runtime , when it is looking for the "global.asa x" file for
the class, it should change to find the class in the
"IISTestSite_de ploy.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.)

Jun 16 '06 #3
Hello Ron,

Have you tried the code Steven suggested:

==========
protected void Page_Load(objec t sender, EventArgs e)
{
Response.Write( "<br/>ApplicationIns tance: " +
Context.Applica tionInstance.Ge tType().FullNam e);
}
==========

And, what is the result you got on the server?

Regards,

Luke Zhang
Microsoft Online Community 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.)

Jun 19 '06 #4
Ron
OK. I added the line

protected void Page_Load(objec t sender, EventArgs e)
{
Response.Write( "<br/>ApplicationIns tance: " +
Context.Applica tionInstance.Ge tType().FullNam e);
}

when using the "Web Deployment Projects" plugin with "updateable " output on
Server 2003
I get: "ApplicationIns tance: System.Web.Http Application"

When using the original project tree (with source .vb file and all) on
Server 2003
I get: "ApplicationIns tance: ASP.global_asax "
As said before on XP Pro all versions run correctly. the problem only shows
on Server 2003

Thanks,
Ron
"Luke Zhang [MSFT]" <lu******@onlin e.microsoft.com > wrote in message
news:Kd******** ******@TK2MSFTN GXA01.phx.gbl.. . Hello Ron,

Have you tried the code Steven suggested:

==========
protected void Page_Load(objec t sender, EventArgs e)
{
Response.Write( "<br/>ApplicationIns tance: " +
Context.Applica tionInstance.Ge tType().FullNam e);
}
==========

And, what is the result you got on the server?

Regards,

Luke Zhang
Microsoft Online Community 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.)

Jun 19 '06 #5
Hi, I have the same problem.

I found this on a forum: http://forums.asp.net/thread/1253331.aspx
"Changing the name of the Application_Sta rt method to Application_OnS tart
fixed it for me."

any sense to that?

Also, after I add a virtual dircetory containing the vb files (not the
deploy version), and run it in IE, it runs well. Then, after that one "run",
if I try to ruin the deploy/merged version again, it works. It seems that
one good "run" loads that global or what ever the problematic file to memory
and it will work from now on.

My problem now is that I cannot find how to take it back to not working,
without ghosting the computer. Restarting IIS did not help (it still works).
After ghosting however, again it will not work.

"Luke Zhang [MSFT]" <lu******@onlin e.microsoft.com > wrote in message
news:Kd******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hello Ron,

Have you tried the code Steven suggested:

==========
protected void Page_Load(objec t sender, EventArgs e)
{
Response.Write( "<br/>ApplicationIns tance: " +
Context.Applica tionInstance.Ge tType().FullNam e);
}
==========

And, what is the result you got on the server?

Regards,

Luke Zhang
Microsoft Online Community 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.)

Jun 20 '06 #6
Hello Ron,

Since the deployment project works well on the windows XP computer, it make
us believe this is nothing with the deployment project. It is more like a
computer specified problem. (The difference between XP and 2003 won't make
such a problem). I suggest you try re-register ASP.NET 2.0 to see if it can
help, for example, First run following commands in VS 2005 Command Prompt
window:

aspnet_regiis -ua

to remove ASP.NET and then run:

aspnet_regiis -i

and reset IIS.

Will this help on the issue?

Luke Zhang
Microsoft Online Community 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.)

Jun 21 '06 #7
It doesn't help. I tried it.
I still think it is a 2003 issue. Did you try to build a web project on XP
and then copy the files and see it work on 2003? A CLEAN 2003, one that has
never had VS on and never executed different ASP projects.

One small possibility: The fact that once I run the vb version on 2003 and
it works, it will then also run the deploy version. So I guess that the
global file gets put in memory and is not needed to be re loaded to memory.
Maybe the only reason it works on XP computers is the fact that they all, in
the past, loaded a vb version of the web project...
"Luke Zhang [MSFT]" <lu******@onlin e.microsoft.com > wrote in message
news:fh******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hello Ron,

Since the deployment project works well on the windows XP computer, it
make
us believe this is nothing with the deployment project. It is more like a
computer specified problem. (The difference between XP and 2003 won't make
such a problem). I suggest you try re-register ASP.NET 2.0 to see if it
can
help, for example, First run following commands in VS 2005 Command Prompt
window:

aspnet_regiis -ua

to remove ASP.NET and then run:

aspnet_regiis -i

and reset IIS.

Will this help on the issue?

Luke Zhang
Microsoft Online Community 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.)

Jun 21 '06 #8
Hello,

After you run the VB version, you may execute the command "iisreset" in a
command prompt windows and then test the deploy version again, will it also
work?

Also, did you test with only one partcular project or you have test
multiple projects? Is it possible for you to send me the project so that I
can test it on my side? In my test, it always worked on a windows 2003
server. (You may check the deploy version virtual folder's properties, in
IIS manager, Is it use same .NET framework versio?)

Thanks,

Luke Zhang
Microsoft Online Community 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.)

Jun 22 '06 #9
Ron
Nothing helps :(
It does not load the ASP.global_asax on the W2K3 server on my deployed app.
It does however load it on other new applications I create.
What can be wrong on my app that will make it skip loading the
ASP.global_asax ?

Thanks,
Ron

"Luke Zhang [MSFT]" wrote:
Hello,

After you run the VB version, you may execute the command "iisreset" in a
command prompt windows and then test the deploy version again, will it also
work?

Also, did you test with only one partcular project or you have test
multiple projects? Is it possible for you to send me the project so that I
can test it on my side? In my test, it always worked on a windows 2003
server. (You may check the deploy version virtual folder's properties, in
IIS manager, Is it use same .NET framework versio?)

Thanks,

Luke Zhang
Microsoft Online Community 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.)

Jul 12 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
828
by: Jon Maz | last post by:
Hi All, I would like to have the following folder structure for an asp.net website: MasterFolder |---\AppRoot | --- webform.aspx | --- web.config | --- global.asax
1
3738
by: noname | last post by:
i have the following in global.asax: <%@ Application Codebehind="Global.asax.cs" Inherits="Foo.Global" Classname="AppClass" %> but wherever i use AppClass.foo() i get the compiler error: The type or namespace name 'AppClass' could not be found (are you missing a using directive or an assembly reference?) am i missing something? thanks.
1
1485
by: webfitz | last post by:
I just wanted to hear some ideas and what some have done on this. I'm having a problem deciding how to build or setup our application. This will be an application for our entire company of 700 employees and we have several different departments and groups. After talking with one developer we thought it would be a bad move to develop the whole...
22
3743
by: fd123456 | last post by:
Hi Tom ! Sorry about the messy quoting, Google is playing tricks on me at the moment. > Global.asax is where you normally have the Global Application > and Session variables and code to manipulate them. It starts > and ends with <script></script> tags. > > Yours looks like a compiled version of it.
8
4849
by: Vishwanathan Raman | last post by:
Hi I have a declared a static DataSet object SOBJ in Global.asax.I also have a localy defined DataSet LSOBJ in Global.asax which I am storing in Application State.Is there any technical differences in the way both the objects are handled by IIS. Are both objects stored in different memory spaces? I can access both the objects in my web...
7
5209
by: Ankit Aneja | last post by:
I put the code for url rewrite in my Application_BeginRequest on global.ascx some .aspx pages are in root ,some in folder named admin and some in folder named user aspx pages which are in user folder are using this code of url rewrite project is running completely fine on localhost but after uploading first page...
2
3693
by: Steve | last post by:
I am new to this newsgroup & to .NET in general. I have been playing around with Visual Studio .NET, building and rendering web pages using VB "code behind" files. My problem / question is; How do I ensure that changes made to the "Global.asax.vb" file are immediately reflected in the "Global.asax" file? After I change to the...
4
9006
by: Hardy Wang | last post by:
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...
16
5017
by: thefritz_j | last post by:
We just converted our VS2003 1.1 VB web project (which was working fine) to VS2005 2.0 and now I get: Parser Error Message: Could not load type '<Namespace>.'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="<Namespace>." %> I've done a lot of things I've found on the web to no avial, but here are some...
0
7465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7416
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5969
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5325
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3449
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.