Michael Van Cleave
Traveling the technical world, learning the language

Running ASP.NET 1.1 Applications with Session under Sharepoint 2007

Monday, December 11, 2006 1:02 PM

Of late I have been working with a forward thinking company that has been deploying Sharepoint 2007 to production and using it as its Intranet.

Last night we upgraded the production servers to the RTM version from B2TR.  Everything seemed to go great upgrading the servers but this implementation was a little different.  The company has about 14 web applications that need to be reference from the sharepoint portal and they all are classic ASP or ASP.NET 1.1 applications.  Still nothing strange there right?

We do the conversion and everything goes smooth. we install the virtual directories under the portal (sharepoint) web, and again everything seems to go smoothly.  Click through the pages that hit the external applications and we find that all of the ASP.NET 1.1 applications that utilize session state get a very interesting error:

Server Error in '/XXXXXXX' Application.

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration.

So after hunting and hunting, a very sharp guy on the team finds that the Web.config in the virtual directory for Sharepoint (<drive>://inetpub/wwwroot/wss/virtualdirectories/80) has the <pages> entry defined as:

    <pages enableSessionState="false" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" asyncTimeout="7">

We flipped the enableSessionState flag to true and low and behold no more error.

This took us a while to find and I know if the individual that found it didn't by chance see it then we would still be looking for this fix.

So, if you seem to encounter this issue, try giving the enableSessionState bit a flip and see what happens.

Michael


Feedback

# session state accessed from a webpart

when i tried to access the session variables from a webpart, i got the same error. I hav already tried the fix you described. it didn't work. any help? 3/6/2007 5:31 AM | Jay

# re: Running ASP.NET 1.1 Applications with Session under Sharepoint 2007

The part that I described was for using session state in linked in ASP.NET 1.1 applications to sharepoint 2007.

In your case you want to be sure that session state is configured for Sharepoint in the Central Administration. That should work. Although, I have never tried to use session state from a web part.

hth

Michael 3/6/2007 10:25 AM | Michael

# re: Running ASP.NET 1.1 Applications with Session under Sharepoint 2007

In our application we are using session variables. and we have given session timeout for 60 minutes but still we are getting "Object reference not set to an instance of an object" Error.


Can i get the solution for this?


And i want to know What is the maximum session expiry we can give in sharepoint 2007? 7/18/2007 10:25 PM | shwetha

# re: Running ASP.NET 1.1 Applications with Session under Sharepoint 2007

Interesting. I am not quite sure why you would want to have a session stay open that long, but if that is necessary then that is okay too.

I think that the Object reference error you are getting may not be related to the session, and increasing the session timeout probably wouldn't fix it.

Is there any more event log errors or information you can supply that might make it a bit easier to point you in the right direction?

Michael 7/18/2007 10:31 PM | Michael

# re: Running ASP.NET 1.1 Applications with Session under Sharepoint 2007

Hi there,
The timeout issue that I am trying to grapple with is the timeout not cutting in at all. You didn't encounter that after thinking you had it working? As a point of difference, we are using ASP.NET 2.0 controls within Sharepoint 2007 pages.
9/30/2007 5:56 PM | Brian

# re: Running ASP.NET 1.1 Applications with Session under Sharepoint 2007

Hmmm.. What do you have the current session timeout set at? Also, check to be sure that the session timeout is not set in another competing web.config that might be overriding the session timeout for you web application.

Michael 9/30/2007 8:20 PM | Michael

Post a comment





 

Please add 6 and 2 and type the answer here:




Archives

Post Categories

Great Links

Other Blogs

Pod Casts

Syndication: