visual studio not updating html / javascript to se

2019-01-14 06:56发布

This is an MVC 4 app using the Hot Towel SPA template. Whenever I change anything in the HTML and/or javascript the only way I can get the new code to display is to clear the browser cache. F5, cntrl-F5, shift-F5, nothing works.

I'm not normally a web dev and just learning this. I've done regular MVC before and not had this issue, maybe it has to do with where the HTML and javascript is in my project (i.e. in the /App folder) ?. I'm going nuts trying to figure this out.

I can completely delete an HTML file and run the app and it still runs as it did. Clear cache and run and I then get the update.

It's running using IIS express using Firefox, Chrome, IE...

Thanks..

10条回答
孤傲高冷的网名
2楼-- · 2019-01-14 07:24

I also experienced this issue and turns out it was related to caching.

If using Chrome DevTools, you can simply disable cache by navigating to the Network Tab and ticking Disable Cache

This will only disable the cache when Dev Tools is open.

查看更多
可以哭但决不认输i
3楼-- · 2019-01-14 07:25

in my case iis express not updated site, but site , created by iis Manager worked correctly?

possible solution for this problem is set "use this 64 bit version of iis express for web sites and projects" option at visual studio it located at options->Projects and Solutions->Web projects

查看更多
欢心
4楼-- · 2019-01-14 07:25

If you just want to test locally You can try

A) Create Virtual Directory Follow below path: Project / Properties / Web
Find Servers section Click on Create Virtual directory

B) Follow below path: Project / Properties / Web
Find Servers section Click on Drop down and change the selected value between Express and Local Then Create Virtual directory

查看更多
对你真心纯属浪费
5楼-- · 2019-01-14 07:30

ctrl+shift+F5 will do the trick! Seems like browser cache is part of the problem :)

查看更多
登录 后发表回答