10

I have an ASP.Net 2.0 application in which the Session_Start event is not firing in my Global.asax file. Can anyone tell why this is happening and how I can get it working?

The application worked fine on my Windows XP development machine, but stopped working when deployed to the server (Win Server 2003/IIS 6/ASP.Net 2.0).

I'm not sure if this is relevant, but the server also hosts a SharePoint installation (WSS 3.0) which I know does change some settings at the default web site level.

Gulzar Nazim
  • 51,744
  • 26
  • 128
  • 170
Jazza
  • 1,042
  • 1
  • 9
  • 22

4 Answers4

2

Is the site precompiled before adding global.asax? Try compiling it again.

Gulzar Nazim
  • 51,744
  • 26
  • 128
  • 170
  • The entire site has been compiled and recompiled several times, I can step into other code that is in the Global.asax file e.g. Application_Start() – Jazza Sep 16 '08 at 13:07
  • can you create a copy of the site and see if the problem occurs on the copy as well? – Gulzar Nazim Sep 16 '08 at 13:18
  • 2
    Whilst not quite answering the question, the point about whether or not the site was precompiled was just the hint I needed to solve the problem, which was a missing PrecompiledApp.config file on the production server. Thanks @Gulzar – Jazza Aug 26 '09 at 13:41
1

Is the <session /> section in the web.config?

craigmoliver
  • 6,499
  • 12
  • 49
  • 90
0

I had to remove the following tag in SharePoint 2010 web.config:

< remove name="Session" />

0

Are you sure the website in IIS is set to use ASP.NET 2.0 rather than 1.1?

BigJump
  • 15,561
  • 3
  • 31
  • 29