Click to See Complete Forum and Search --> : Problem with session


jag_chat
May 20th, 2004, 06:43 AM
I need to design a web site with more than 500 aspx files. If I include all of those files in a single web project, the duration of compilation and execution (along with debugging) through VS.NET is dead slow. As it has 17 modules, I decided to create 17 web projects in a single solution, so that I can compile only the modules (projects) I want. Till here everything is fine.

But the session state is not getting shared among all the projects in the solution. It exists only within the startup project. The members I put into Session in the startup project are accessible only within that project and not getting accessible in any other project within that solution.

So, I would like to have a "Multiple web project solution" to be designed having the common session, application and other states. Is it possible? Or else any other best suggestion to solve my issue!!

The hierarchy of Virtual directory structure, I created is something like as follows:

c:\inetpub\wwwroot
\ApplicationProject -->Startup web project (Virtual Directory)
\SubProject1 -->first Module (Virtual Directory)
\SubProject2 -->second Module (Virtual Directory)
\SubProject3 -->third Module (Virtual Directory)

TheCPUWizard
May 20th, 2004, 08:49 AM
You have created an inherent conflict here.

My first question is are you sure you really need 500+ distinct, independant web pages. I have done a decent number of LARGE corporate sites. If there is any consistancy to the site design, the number of distinct pages can be greatly reduced by the use of custom controls [which live hapilly in their own projects :) ], templated pages and inheritance.

If you really do need this many pages, and really can not afford the compile time, then you should probably not use session state per-se.

coolbiz
May 21st, 2004, 07:21 AM
2 suggestions:
1. Use DB as your session states storage (this way it can be shared amongst multiple application).

2. Put all DLLs in the same virtual directory (of course the DLL names have to be different and also the NAMESPACE). Since SESSION is maintained per IIS APPLICATION, the same virtual directory uses only one APPLICATION object which in theory should retains the SESSION states across all modules.

I've never done this one myself but I think someone at work has implemented putting 2 different web apps in the same virtual directory and using SESSION for sharing state data.

-Cool Bizs