views:

1272

answers:

1

Does the same process apply for session state when a dll is placed in the bin as when placed in the GAC?

Or is there some type of esoteric change that take place under the hood?

I’ve got a test solution deployed to the bin directory of my sharepoint site that uses session state. I made sure that session state is configured in my web.config file...

<add name="Session" type="System.Web.SessionState.SessionStateModule" />

enableSessionState="true"

Everything works fine!

Then I copied this project into another solution that is deployed to the GAC and activated on a different sharepoint site. I make sure to turn on session state in the web.config file for this different sharepoint site. I browse to my page that uses session state and get this error…

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 \ section in the application configuration.

Marvelous! The only difference as I can see it is that one solution is deployed to the Bin folder and the other is deployed to the GAC.

Some days I hate Sharepoint.

Update on this: I created a simple sharepoint solution with one page that’s deployed to the GAC, this page adds a value to a session variable and then reads it back from the session variable into a label control.

I deployed the solution to my test and production site, It work as expected in the test site but produces the error…

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 \ section in the application configuration.

On my production site, why, why, why?

I checked and rechecked my web.config file and central admin to make sure session state is enabled. This now seems to point to a problem with my sharepoint web app.

Update on this 2: It's the master page! I’ve just found by switching the master page to an out of the box choice allows my code to run correctly - which uses session variables. I've also noticed the custom master page doesn't like the 'autoeventwireup=true' page directive. I've done a text comparison between the two master pages and can see nothing different in the Tagprefix. I'll continue looking...

Update 3 It's probably easier to close this question and start a new one with some additional information.

New question here

A: 

Is it possible there are some controls on the OOTB master and not on your own master? Maybe there's a problem there. Furthermore, your custom master, does that also have a custom code-behind?

Colin