1

Currently I force ASP.NET to rebuild a web application by changing the web.config. However, I would prefer to do it via C# code (including clearing cache etc). How could I go about doing this.

SamWM
  • 4,996
  • 11
  • 55
  • 84
  • Dup? http://stackoverflow.com/questions/1080255/how-do-i-force-asp-net-to-invalid-and-thus-reload-the-current-application-insta – Marc Gravell Sep 30 '09 at 11:17
  • Thanks, missed that one. Used the code by Rick Stahl (http://www.west-wind.com/Weblog/posts/5688.aspx) – SamWM Sep 30 '09 at 12:32

2 Answers2

0

Are you talking about live, on a web server? You could stop/start the application within IIS, and probably via a PowerShell or WMI script.

Neil Barnwell
  • 39,780
  • 28
  • 147
  • 218
0

Used code from 'Recycling an ASP.NET Application from within' to do this via code.

SamWM
  • 4,996
  • 11
  • 55
  • 84