Solved

My web site does not always call Global.asax

Posted on 2011-02-11
9
536 Views
Last Modified: 2012-05-11
Unless I specifically rebuild my website, upon running the application from Visual Studio, the line of command does not stop at a breakpoint in the Global.asax file. It's like the object is in memory and the code is ignored.


Can someone please explain this to me?

Thanks,
newbieweb


0
Comment
Question by:newbieweb
9 Comments
 
LVL 13

Assisted Solution

by:devlab2012
devlab2012 earned 200 total points
ID: 34872550
When you run website from visual studio, it is run under ASP.NET Development Server. See the small icon at the bottom right of the window. You have to stop the application from there and then restart it from visual studio. Otherwise if you simply stop from visual studio window, application is still running in ASP.NET Development Server.
0
 
LVL 15

Expert Comment

by:jorge_toriz
ID: 34872574
Into which event are you putting your breakpoint?
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 300 total points
ID: 34872622
Sounds like you are using the Application_Start event which only runs the first time the applciation starts try using the session_start event instead
0
 

Author Comment

by:newbieweb
ID: 34873413
Yes, I was using Application_Start. But I want it called each time I start. I now understand (from the first post) why it was only hitting in Application_Start after I recompiled. But I'd like to use a method where I do not need to stop the integrated dev. environment. What property gets called each time I start the website, regardless of whether I am running from VS or not?

0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 29

Expert Comment

by:Paul Jackson
ID: 34873444
As I said in my previous post I think you want Session_start
0
 

Author Comment

by:newbieweb
ID: 34873484
I tried making a constructor for Global, but that did not work because Contact was null.
0
 

Assisted Solution

by:newbieweb
newbieweb earned 0 total points
ID: 34873518
Sorry, I missed that...
0
 

Author Comment

by:newbieweb
ID: 34880581
I'd like this question re-opened so I can make sure my answer is not listed as having contributed to the answer.
0
 

Author Closing Comment

by:newbieweb
ID: 34904816
Thanks.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now