?
Solved

Global.asax in Multiple Project Solution

Posted on 2009-02-19
13
Medium Priority
?
1,154 Views
Last Modified: 2012-06-27
I have a large enterprise solution that uses a main web application as the parent of any number of sub web applications. The problem is, my sub web application needs to handle session start/end events, etc. When I run the solution, the Global.asax in the sub web application is never used. I can't use the Global.asax in the main web application because some of the functionality in the sub web application must be separate.

So, I guess - how do I access global events such as Session start/end, etc., from a sub web application?
0
Comment
Question by:hehdaddy
  • 6
  • 5
  • 2
13 Comments
 
LVL 12

Expert Comment

by:CB_Thirumalai
ID: 23688077
Are those sub web apps inside the main application folder?  If so, I think making those sub-folders work as a website will solve this issue.
Inetmgr from Start - Run -> your web site -> expand tree -> right-click sub folder -> click properties -> In the Directory tab -> click Create button.
0
 
LVL 6

Author Comment

by:hehdaddy
ID: 23688192
Yes, the sub apps are inside the main application folder. I tried your solution in Inetmgr, but when I ran the app, Windows keeps prompting me to enter a username and password. I went back and removed it.
0
 
LVL 15

Expert Comment

by:aibusinesssolutions
ID: 23688225
You'll need to specify the Application Pool after you click the Create button.  Make sure the application pool matches the one for the main root directory website.  
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 12

Expert Comment

by:CB_Thirumalai
ID: 23688231
What is the OS?  Are the sub-folders that you converted to website using the same application pool as the main application?  What is the authentication level set for that and try the same authentication level for the sub-folder level app too.  Do as I said above and go to the Directory Security and set the same level of access to the sub-folder too.
0
 
LVL 6

Author Comment

by:hehdaddy
ID: 23688330
My development environment is XP, so I have IIS 5.1 - I don't think I can specify the application pool - only isolation (low/medium/high).

The authentication level is the same on both, set to allow anonymous access along with integrated Windows authentication. The Directory Security is the same on the sub-folder too.

The production environments are Windows Server 2003.
0
 
LVL 15

Expert Comment

by:aibusinesssolutions
ID: 23688378
You'll want to match production environment and development environment as closely as possible,  I suggest installing IIS 6.0 on your dev machine.

http://www.empoweris.com/2008/01/15/howto-install-iis-60-in-xp-pro-without-cd/
0
 
LVL 6

Author Comment

by:hehdaddy
ID: 23689038
Unfortunately, only the 64bit version of XP uses IIS 6.0.
0
 
LVL 6

Author Comment

by:hehdaddy
ID: 23689251
I am increasing the point value for you folks.
0
 
LVL 15

Expert Comment

by:aibusinesssolutions
ID: 23691806
Ah Ok, well if you can't use IIS 6 on your dev machine, then you could make new web site in the root folder.  Just right click on "websites", and click new website, put in a name for it, then select the folder that contains the website.  This should create a stand alone application for that folder.

I think folks have had a lot of problems with IIS 5.1 in development which is why they now include a built in web server with Visual Studio .NET.
0
 
LVL 6

Author Comment

by:hehdaddy
ID: 23693452
We're using Visual Studio 2008 TS Developer Edition, so I can use the build in dev web server. The issue is, what should the configuration be in the project > properties > web tab for the main and sub app?

Which circles me around back to my original problem. How can I see and execute global.asax events in my sub app (session start/end, etc.)?

I have upped the points for you folks.
0
 
LVL 6

Author Comment

by:hehdaddy
ID: 23695777
Hi there. I did some more research with my team and we found that in a parent/sub app configuration, the parent app will always assume control of the global operations - even if the Global.asax.cs doesn't exist. The sub app will never get to process those session start/end, events, etc.
0
 
LVL 15

Accepted Solution

by:
aibusinesssolutions earned 1800 total points
ID: 23696005
The sub app can and will process it's own global.asax file if you create the sub app as an application through IIS6.0.
0
 
LVL 15

Expert Comment

by:aibusinesssolutions
ID: 23696010
You may not be able to test it locally in your development environment, but you can set it up in the production environment as multiple applications under one app, the only thing that they will inherit is the web.config file, but that can be disabled as well.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Screencast - Getting to Know the Pipeline
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question