10

When I update a cshtml file in my MVC project in Visual Studio 2015, the html changes are not getting updated when I refresh the browser. I am using chrome and have dev tools open. Dev tools is set to disable cache when open. If I clean the solution and rebuild then the my change makes it successfully. But If I just refresh the browser the update does not happen. If I delete all my temporary internet files and start debugging again, I can sometimes make a few changes to the cshtml files and they will work when I refresh but after a little while it stops working.

I have noticed that when it works correctly visual studio is creating 2 files named app_web_(some junk letters).dll.delete and another other titled the same called .pdb.delete. When I refresh the browser it creates a bunch of new files and my html change makes it to the browser.

When it stops working visual studio no longer creates the delete files in the temporary internet files folder.

For the record they are in the root directory of temporary internet files.

Also, this solution was originally created in VS 2013 but I am now using 2015. It always worked when i used 2013

Ryand.Johnson
  • 1,906
  • 2
  • 16
  • 22

2 Answers2

4

The problem is most probably caused from caching problems on the related Windows directories that Visual Studio or web browser use. For fixing the problem you might try to clean the contents in the following cache folders (do not delete these folders, instead delete their contents only) and restart Visual Studio:

  • Clean the content in WebSiteCache folder (can be found in
    C:\Users%USERNAME%\AppData\Local\Microsoft\WebSiteCache)

  • Clean the content in Temporary ASP.NET Files folder (can be found in
    C:\Users%USERNAME%\AppData\Local\Temp\Temporary ASP.NET Files)

  • Clean Asp.NET Cache in root folders (can be found in
    C:\Windows\Microsoft.NET\ Framework\ ... \Temporary ASP.NET Files\root
    or
    C:\Windows\Microsoft.NET\Framework64\ ... \Temporary ASP.NET Files\root)

  • Delete the browser history by selecting the period from the beginning.

And then restart Visual Studio. If the problem continues you might try to rename the project folder and reopen it again.

Murat Yıldız
  • 11,299
  • 6
  • 63
  • 63
0

Try with hard reload: Push F12 on Windows (On Mac: Cmd+Opt+I) then you can right click on refresh and select 'Empty Cache and Hard Reload' from https://superuser.com/a/512833

Community
  • 1
  • 1
NikNik
  • 2,191
  • 2
  • 15
  • 34