Several things that cause Program Restart in ASP. NET

Source: Internet
Author: User
Recently, I was working on a project. Because files are modified, added, and deleted in the project, all these operations were completed when IIS was running, and the progress was also tracked, it involves threads and so on. Therefore, we apply static variables to complete this trail. However, when the project is running, static variables often fail, and this result is caused by the application of IIS.ProgramRestart the application pool to reclaim static variables. I didn't notice this problem before, so I figured it out for a long time.

There may be many ways to restart the application, but this time I met the following several methods, maybe this is what I wrote down.

1. As long as we update the web. config file, replacing the file will cause the application to restart;

2. The update of the global Global. asax file will also cause the restart. This file is an application, a bit like a pipeline model;

3. An update to the bin directory also causes file restart;

4 ....

The restart of the application will invalidate all our variables, caches, and so on, and sometimes bring us the desired results. This application also encountered thread operations. currentthread. when abort () is used to terminate a thread, an error is thrown, which corresponds to response. redirect (string) has the same effect, so try {} catch {} cannot be used.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.