JG Vimalan's Blog

It is all about coding!

HttpContext.Current return null in IIS 7

One of my team member was complaining to me that, the application works good at his development system but, when deployed to QC, the particular page throws a null exception.

I found that, the code ‘HttpContext.Current.Session[Constant.SortDirection]’ is causing the error and the Current is null.

Inorder to fix this issue, the Session state should be set properly for the application in IIS.

Earlier, Session state was disabled because of which, the Current object is null. After setting the Session state, it worked correctly.

About these ads

May 31, 2011 - Posted by | C#.NET, IIS 7

2 Comments »

  1. I applied settings as above. But still not working for me.. Still the Session variable is null while running from IIS7 .It works fine when I run it from development application.

    Comment by MMC | September 28, 2011 | Reply

    • What is the IIS version in your dev system? Could you please post the code block where you are experiencing null session state?

      Comment by JG Vimalan | September 28, 2011 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: