Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8596309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:38:45+00:00 2026-06-12T00:38:45+00:00

I have an ASP.Net application that performs some database initialization during Application_Start in Global.asax.

  • 0

I have an ASP.Net application that performs some database initialization during Application_Start in Global.asax. I’m using IIS Express to debug the application.

I find that if I stop debugging, clear the database, and restart again, the Application_Start code does not get called and my database is not initialized properly, so my application fails. This is because the IIS Express instance is still running after debugging stops. Rather than restarting it, Visual Studio appears to be attaching to the existing process.

Is there a way to change this behavior such that starting a new debugging session always restarts the application process in IIS Express (or resets the application pool in regular IIS)?

Alternatively, is there a way to force IIS Express to shut down when the debugging session ends?

I did find that if I check “Enable Edit and Continue” from the Web dialog in the project settings, that it has the side effect of stopping IIS Express when debugging ends. But I’m not sure I want to introduce the side-effects of Edit and Continue just for the purposes of stopping IIS Express. Surely there’s a better way?

Not sure if it matters, but this is VS2012.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:38:46+00:00Added an answer on June 12, 2026 at 12:38 am

    Unfortunately it’s not achievable through configuration. I may propose you another trick, but it’s up to you to decide whether it’s better than yours or not 🙂

    You may create a post-build event which changes the timestamp of a web.config file. I used a touch.exe tool from http://www.stevemiller.net/apps/. You also need to set the “Run the post-build event” to Always. So your “Build Events” configuration may look as follows:

    enter image description here

    With this option set anytime you start the debugger, web.config timestamp is getting updated causing application restart (application appdomain reload) on the first request – but at this point you are already attached to this process so your Application_ event breakpoints should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small conundrum where I have an asp.net application that's using forms
I have a database on SQL Server 2008. I have an ASP.NET application that
I have a Generic HTTP Handler (*.ashx) in my ASP.Net application which performs some
I have an ASP.NET WebApi application that has some controller methods that expect certain
I have an ASP.NET 2.0 application under IIS that has the functionnality of exporting
I have an ASP.NET MVC (using the release candidate) application that works with a
I have an ASP.NET application that is hosted in timezone A and is being
I have an ASP.NET application that uses a custom .NET library (a .DLL file).
I have an ASP.NET application that calls other web services through SSL (outside the
I have an ASP.Net Application that sends text messages to mobile phones. It does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.