Visual Studio 不将 html/javascript 更新到服务器/浏览器 [英] visual studio not updating html / javascript to server / browser

查看:24
本文介绍了Visual Studio 不将 html/javascript 更新到服务器/浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个使用 Hot Towel SPA 模板的 MVC 4 应用程序.每当我更改 HTML 和/或 javascript 中的任何内容时,我可以显示新代码的唯一方法是清除浏览器缓存.F5,cntrl-F5,shift-F5,没有任何作用.

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.

我通常不是网络开发人员,只是在学习这个.我以前做过常规 MVC 并且没有遇到过这个问题,也许这与 HTML 和 javascript 在我的项目中的位置有关(即在/App 文件夹中)?.想弄明白这个我快要疯了.

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.

我可以完全删除一个 HTML 文件并运行该应用程序,它仍然可以正常运行.清除缓存并运行,然后我会得到更新.

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.

它使用 IIS express 运行,使用 Firefox、Chrome、IE...

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

谢谢...

推荐答案

在 Opera 和 Chrome(可能还有其他)中,您可以在开发模式"下禁用缓存.

In Opera and Chrome (and possibly others), you can disable caching while in 'development mode'.

在 DevTools 中,设置菜单中的第二个选项是

While in DevTools, the 2nd option in the Settings menu is

禁用缓存(DevTools 打开时)

Disable cache (while DevTools is open)

这篇关于Visual Studio 不将 html/javascript 更新到服务器/浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆