Request is not available in this context

I encountered something I wasn’t expecting today, not that unusual occurrence in coding, I know.

I was happily deploying a site, throwing all my files onto my hosting provider, when I had the radical idea of testing my deployment. Crazy! And what should I encounter was this error:

Request is not available in this context

Hmm, that was a new one. It was firing from the Global.asax file, specifically, the Application_Start event. Nothing there but some variable initializations, you know, the standard stuff.

But no more initializations in the Application_Start anymore I discovered when I went searching for a resolution to my problem. I found a post which provided the details of why I was getting that crafty message. Even the title of the post was right on: IIS7 Integrated mode: Request is not available in this context exception in Application_Start.

So I moved my initializations outside of the Global.asax file and put them elsewhere. Not that hard a fix, just nothing I had seen before.

Advertisements
  1. Leave a comment

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

%d bloggers like this: