eejai42
eejai42

Reputation: 746

Old IIS Site Cached after Publish VS2012

I am used to having IIS automatically reset a website any time any of it's "key" files change (such as the DLL's in the bin folder or changes to the web.config). As a result, any time I "publish" the website using VS2012 - the target IIS site (even if it's on another server) always restarts itself so that additional testing can be done.

A project I'm working on this week for some reason is not doing this. I can completely delete and republish the site - and yet IIS keeps serving up the "old" content until I recycle the associated AppPool. It reliably updates when I recycle the AppPool - and reliably does NOT update until I do so (seemingly regardless of which files are on the disk).

It's as though it's caching my entire ASP.NET 3.5 website. I have been working with IIS for almost 20 years, and I've never seen it behave anything like this.

Any suggestions/ideas?

Upvotes: 1

Views: 168

Answers (1)

Alex
Alex

Reputation: 23300

This statement allows you to programmatically recycle the AppDomain (similar to recycling the whole AppPool, but involving only the current application so anything else is untouched)

HttpRuntime.UnloadAppDomain();

I usually #if(DEBUG) it in my projects so it doesn't make its way out of the dev environment.

Upvotes: 1

Related Questions