Solved

My web site does not always call Global.asax

Posted on 2011-02-11
9
542 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

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
 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

840 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