Let's consider a simple ASP .Net MVC project that is hosted on IIS. When I build project IIS still uses old code. Even if I clean the project, and make sure that bin folder is empty, - the site still returns a response. In order to use the latest code, I need to restart the application pool. Any ideas what is the reason?
Asked
Active
Viewed 731 times
0
-
Does this answer your question? [IIS 8.5 Serving Old Files](https://stackoverflow.com/questions/36671919/iis-8-5-serving-old-files) – OnePage Apr 15 '20 at 15:44
-
Unfortenently no – Basil Kosovan Apr 15 '20 at 15:50
-
When you build or deploy the project? When you deploy are you including the dll files? If yes then when you deploy ddl files the apppool should automatically restart the application and load your new changes. – Rahatur Apr 15 '20 at 15:58
-
It's the issue on my local sandbox – Basil Kosovan Apr 15 '20 at 15:59
-
Meaning when you run the code in VisualStudio? – Rahatur Apr 15 '20 at 16:03
-
When I build the project in VS - bin directory is updated. But I have no idea about IIS. I am not sure that IIS should restart the app pool on build event – Basil Kosovan Apr 15 '20 at 16:05
-
Your IIS AppPool right click -> Advanced Settings -> Recycling --> What are the values under [Disable Overlapped Recycle] or [Disable Recycling for Config Changes] – Markuzy Apr 15 '20 at 16:08
-
The value is False for both – Basil Kosovan Apr 15 '20 at 16:10
-
Check this: https://stackoverflow.com/questions/29934588/how-do-i-stop-iis-from-caching-any-files-ever-under-any-circumstances – Arsen Khachaturyan Apr 15 '20 at 16:10
-
@ArsenKhachaturyan It's about the content file not about dll – Basil Kosovan Apr 15 '20 at 16:19
2 Answers
0
I think the reason is the IIS Compression cache!
On the IIS console, click on the website and then on the Compression, and uncheck the Enable static content compression.
This should solve the problem.

OnePage
- 116
- 1
- 13
0
You could try to disable the cache in iis by following below steps:
1)Open iis.
2)Select the site and click on the "HTTP response header feature".
3)Click on the set common header link from the action pane.
4)click the checkbox "expire web content" and select "immediately" radio button.
You could also set output caching in iis:
Note: after deploying site in iis you need to refresh the site so it can fetch the update.

Jalpa Panchal
- 8,251
- 1
- 11
- 26