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
  • 5,196
  • 12
  • 56
  • 85
  • 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
  • 41,080
  • 29
  • 148
  • 220
0

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

SamWM
  • 5,196
  • 12
  • 56
  • 85