473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Session_start not firing in production server

Hello All,

I'm having a problem with global.asax file. The session_start method of
globals.asax.vb is not firing in my project when I copy the files to a
production server. It works OK in my development machine, which has VS2005
on Windows XP SP2.
The production server is a Windows 2000 Server SP4. (Almost a fresh install,
only with .NET FWK 2.0).
I configured a new site in IIS5. Then I compiled the application in the
development machine and copied ALL the files (including the /bin folder) to
the server.

I've checked the global.asax file by putting a breakpoint in the
session_start method and it get hit while debugging (always in MY comp).

Then I removed all the code for testing purposes and left only this:
Sub Session_Start(ByVal sender as object, ByVal e as EventArgs)
Throw New Exception("HEEEELLLOOOOOOO")
End Sub

The server doesn't stop at the exception, so no code is being called. (I
didn't use Diagnostics.EventLog since I had security permissions to
configure and this was a bit quicker to test)

My question is, are there any changes that need to be made in order for this
to work?
I tried these already:
. Changing the compile options of the global.asax (the default is
"Content", and I used "Embedded resource", then changed it back since it
didn't solve my problem).
. Restarting IIS after running
"%windir%\Microsoft.NET\Framework\v2.0.50727\aspne t_regiis.exe -i"
Any suggestions are welcome.
Thanks
__________________
Alejandro

+ Info: The development machine has also "Microsoft visual studio 2005 Web
Application Projects" installed.
Feb 1 '07 #1
6 4916
On Feb 1, 4:00 pm, "Alex" <alek...@hotmail.comwrote:
>
I've checked the global.asax file by putting a breakpoint in the
session_start method and it get hit while debugging (always in MY comp).

Sorry didn't get it, how do you debug remote server?

Feb 1 '07 #2
No no... I didn't debug the remote server... I debug in my development
computer. I did that just to be sure that the method was being called (at
least locally).

Now, I found something weird... if I move the Session_Start code from
global.asax.vb to Global.asax, enclosing it with the <scripttags like
this:
<script runat="server">
Sub Session_Start (....
....
End Sub
</script>

Then the method IS called. I don't know why this is behaving like the old
ASP way. Why does global.asax have a code behind file if it not being used?
"Alexey Smirnov" <al************@gmail.comescribió en el mensaje
news:11**********************@h3g2000cwc.googlegro ups.com...
On Feb 1, 4:00 pm, "Alex" <alek...@hotmail.comwrote:
>>
I've checked the global.asax file by putting a breakpoint in the
session_start method and it get hit while debugging (always in MY comp).


Sorry didn't get it, how do you debug remote server?

Feb 1 '07 #3
In order Global.asax to work you must create an application.
In IIS Managment console right click on your folder and you will see
"Create" next to "Application Name"

On your develoment machine VS does it automaticly when you creating project

George.

"Alex" <al*****@hotmail.comwrote in message
news:u5**************@TK2MSFTNGP03.phx.gbl...
Hello All,

I'm having a problem with global.asax file. The session_start method of
globals.asax.vb is not firing in my project when I copy the files to a
production server. It works OK in my development machine, which has VS2005
on Windows XP SP2.
The production server is a Windows 2000 Server SP4. (Almost a fresh
install, only with .NET FWK 2.0).
I configured a new site in IIS5. Then I compiled the application in the
development machine and copied ALL the files (including the /bin folder)
to the server.

I've checked the global.asax file by putting a breakpoint in the
session_start method and it get hit while debugging (always in MY comp).

Then I removed all the code for testing purposes and left only this:
Sub Session_Start(ByVal sender as object, ByVal e as EventArgs)
Throw New Exception("HEEEELLLOOOOOOO")
End Sub

The server doesn't stop at the exception, so no code is being called. (I
didn't use Diagnostics.EventLog since I had security permissions to
configure and this was a bit quicker to test)

My question is, are there any changes that need to be made in order for
this to work?
I tried these already:
. Changing the compile options of the global.asax (the default is
"Content", and I used "Embedded resource", then changed it back since it
didn't solve my problem).
. Restarting IIS after running
"%windir%\Microsoft.NET\Framework\v2.0.50727\aspne t_regiis.exe -i"
Any suggestions are welcome.
Thanks
__________________
Alejandro

+ Info: The development machine has also "Microsoft visual studio 2005 Web
Application Projects" installed.

Feb 1 '07 #4
Thanks for the tip, but I forgot to mention that I already made an
application in IIS, so that's not the source of the problem... =(

In order Global.asax to work you must create an application.
In IIS Managment console right click on your folder and you will see
"Create" next to "Application Name"

On your develoment machine VS does it automaticly when you creating
project

George.

"Alex" <al*****@hotmail.comwrote in message
news:u5**************@TK2MSFTNGP03.phx.gbl...
>Hello All,

I'm having a problem with global.asax file. The session_start method of
globals.asax.vb is not firing in my project when I copy the files to a
production server. It works OK in my development machine, which has
VS2005 on Windows XP SP2.
The production server is a Windows 2000 Server SP4. (Almost a fresh
install, only with .NET FWK 2.0).
I configured a new site in IIS5. Then I compiled the application in the
development machine and copied ALL the files (including the /bin folder)
to the server.

I've checked the global.asax file by putting a breakpoint in the
session_start method and it get hit while debugging (always in MY comp).

Then I removed all the code for testing purposes and left only this:
Sub Session_Start(ByVal sender as object, ByVal e as EventArgs)
Throw New Exception("HEEEELLLOOOOOOO")
End Sub

The server doesn't stop at the exception, so no code is being called. (I
didn't use Diagnostics.EventLog since I had security permissions to
configure and this was a bit quicker to test)

My question is, are there any changes that need to be made in order for
this to work?
I tried these already:
. Changing the compile options of the global.asax (the default is
"Content", and I used "Embedded resource", then changed it back since it
didn't solve my problem).
. Restarting IIS after running
"%windir%\Microsoft.NET\Framework\v2.0.50727\aspn et_regiis.exe -i"
Any suggestions are welcome.
Thanks
__________________
Alejandro

+ Info: The development machine has also "Microsoft visual studio 2005
Web Application Projects" installed.


Feb 1 '07 #5
I believe what may be happening here is that you have a Web Site project
instead of a Web Application Project. In the web site project model, you will
probably need to put your global.asax.vb file in the APP_CODE folder.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Alex" wrote:
Thanks for the tip, but I forgot to mention that I already made an
application in IIS, so that's not the source of the problem... =(

In order Global.asax to work you must create an application.
In IIS Managment console right click on your folder and you will see
"Create" next to "Application Name"

On your develoment machine VS does it automaticly when you creating
project

George.

"Alex" <al*****@hotmail.comwrote in message
news:u5**************@TK2MSFTNGP03.phx.gbl...
Hello All,

I'm having a problem with global.asax file. The session_start method of
globals.asax.vb is not firing in my project when I copy the files to a
production server. It works OK in my development machine, which has
VS2005 on Windows XP SP2.
The production server is a Windows 2000 Server SP4. (Almost a fresh
install, only with .NET FWK 2.0).
I configured a new site in IIS5. Then I compiled the application in the
development machine and copied ALL the files (including the /bin folder)
to the server.

I've checked the global.asax file by putting a breakpoint in the
session_start method and it get hit while debugging (always in MY comp).

Then I removed all the code for testing purposes and left only this:
Sub Session_Start(ByVal sender as object, ByVal e as EventArgs)
Throw New Exception("HEEEELLLOOOOOOO")
End Sub

The server doesn't stop at the exception, so no code is being called. (I
didn't use Diagnostics.EventLog since I had security permissions to
configure and this was a bit quicker to test)

My question is, are there any changes that need to be made in order for
this to work?
I tried these already:
. Changing the compile options of the global.asax (the default is
"Content", and I used "Embedded resource", then changed it back since it
didn't solve my problem).
. Restarting IIS after running
"%windir%\Microsoft.NET\Framework\v2.0.50727\aspne t_regiis.exe -i"
Any suggestions are welcome.
Thanks
__________________
Alejandro

+ Info: The development machine has also "Microsoft visual studio 2005
Web Application Projects" installed.


Feb 1 '07 #6
No, I created a Web Application Project. Besides, the strange thing is that
the same files work perfect in my development computer, but not in the
server.
That's the reason I think there might be something regarding IIS which
doesn't work with my app in the server.
Thanks for the tip anyway

"Peter Bromberg [C# MVP]" <pb*******@yahoo.yabbadabbadoo.comescribió en el
mensaje news:EB**********************************@microsof t.com...
>I believe what may be happening here is that you have a Web Site project
instead of a Web Application Project. In the web site project model, you
will
probably need to put your global.asax.vb file in the APP_CODE folder.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Alex" wrote:
>Thanks for the tip, but I forgot to mention that I already made an
application in IIS, so that's not the source of the problem... =(

In order Global.asax to work you must create an application.
In IIS Managment console right click on your folder and you will see
"Create" next to "Application Name"

On your develoment machine VS does it automaticly when you creating
project

George.

"Alex" <al*****@hotmail.comwrote in message
news:u5**************@TK2MSFTNGP03.phx.gbl...
Hello All,

I'm having a problem with global.asax file. The session_start method
of
globals.asax.vb is not firing in my project when I copy the files to a
production server. It works OK in my development machine, which has
VS2005 on Windows XP SP2.
The production server is a Windows 2000 Server SP4. (Almost a fresh
install, only with .NET FWK 2.0).
I configured a new site in IIS5. Then I compiled the application in
the
development machine and copied ALL the files (including the /bin
folder)
to the server.

I've checked the global.asax file by putting a breakpoint in the
session_start method and it get hit while debugging (always in MY
comp).

Then I removed all the code for testing purposes and left only this:
Sub Session_Start(ByVal sender as object, ByVal e as EventArgs)
Throw New Exception("HEEEELLLOOOOOOO")
End Sub

The server doesn't stop at the exception, so no code is being called.
(I
didn't use Diagnostics.EventLog since I had security permissions to
configure and this was a bit quicker to test)

My question is, are there any changes that need to be made in order
for
this to work?
I tried these already:
. Changing the compile options of the global.asax (the default is
"Content", and I used "Embedded resource", then changed it back since
it
didn't solve my problem).
. Restarting IIS after running
"%windir%\Microsoft.NET\Framework\v2.0.50727\aspn et_regiis.exe -i"
Any suggestions are welcome.
Thanks
__________________
Alejandro

+ Info: The development machine has also "Microsoft visual studio 2005
Web Application Projects" installed.



Feb 2 '07 #7

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

Similar topics

4
by: M O J O | last post by:
Hi, I have a test application, that is a Web.config, a Global.asax, default.aspx and a final.aspx page. When a user enters my application, I want session_start to always redirect him to the...
1
by: Ian Lane .enizin.net> | last post by:
Hello, I am having a strange issue between my Test environment and my Production environment. The problem is my site runs beautifully on Test and almost beautifully on Production. They are both...
1
by: jcode | last post by:
I have an ASPNET application that has worked correctly on couple of servers. I have just deployed it to another server and cannot resolve an issue. It appears as if the Session_Start is not...
3
by: Joe Befumo | last post by:
I'm workinbg in Visual Studio 2003. I'm experimenting with creating a session variable, and from all I can gather. the Session_Start event is not firing. In Global.asx.vb, in the Session Start...
4
by: Joe Befumo | last post by:
I'm workinbg in Visual Studio 2003. I'm experimenting with creating a session variable, and from all I can gather. the Session_Start event is not firing. In Global.asx.vb, in the Session Start...
7
by: Bruno | last post by:
We are attempting to automatically log users off from the Session_End event in global.asax and set some values on session_start. It is not a critical task, more of a housekeeping task so that we...
3
by: Mufasa | last post by:
I have code in my session_start to create a temp directory for the session. On session_end it is supposed to delete the directory but doesn't seem to be firing. I've enclosed the code below. ...
1
by: rockdale | last post by:
Hi: I have a web application which runs fine on our production server. But now when I install abother production server, it gets "System.NullReferenceException: Object reference not set to an...
5
by: greg | last post by:
Written in Asp.Net 2.0 The session_start fires on Development server running withing Visual Studio 2005 and also if access web site via localhost on development machine. But if copy to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.