'VS2017 with IIS Express not showing latest code changes
I've searched and come across similar topics, but they all relate to ASP.NET core projects.
I have a traditional ASP.NET MVC web app using the .NET 4.6.2 framework.
When I run this project without debugging (CTRL + F5) I am able to see all changes made to html, js, and css files by simply refreshing my browser.
However, if I make a code change to a .cs file and refresh the browser the change is not shown. It obviously needs to be recompiled - if I then manually build the project, and then refresh the browser the latest change made to the .cs file is then visible.
Is there anyway I can make VS/IISExpress detect a code change, which then will automatically force the app to rebuild?
Here is an example of what I would like:
https://youtu.be/yyBijyCI5Sk?t=880
^ He modifies code (c#), saves the file, jumps back to his browser, hits refresh which then forces a recompile for a few seconds and then reveals the changes. The project in this video is using ASP.NET core, so I guess automatic compilation is a feature of it.
Any ideas how to achieve similar for non-core asp.net projects?
Thanks
Solution 1:[1]
I dont know of any way to let browser force VS to rebuild project, however based on video. You could use something like link.
It is an extension which rebuilds your poject on save. So all .cs changes will be visible after save(build).
I dont personaly use it, just know it exists
Hope it helps.
Solution 2:[2]
Clear visual studio cache. step3 working fine for me. Step 1: clear the Component Cache
- Close Visual Studio (ensure devenv.exe is not present in the Task Manager)
- Delete the %USERPROFILE%\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache directory
- Restart Visual Studio.
Step 2: cleanup your user’s temp folder
Delete the %USERPROFILE%\AppData\Local\Temp directory.
If all the above fails. you can try the hard route.
Step 3: delete the contents from the following folders
%USERPROFILE%\AppData\Local\Microsoft\Team Foundation %USERPROFILE%\AppData\Local\Microsoft\VisualStudio %USERPROFILE%\AppData\Local\Microsoft\VSCommon
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Kamil Folwarczny |
| Solution 2 | david5 |
