How to force Chrome browser to reload .css file while debugging in Visual Studio?

问题:

I'm currently editing a .css file inside of Visual Studio 2012 (in debug mode).我目前正在 Visual Studio 2012 中编辑一个 .css 文件(在调试模式下)。 I'm using Chrome as my browser.我使用 Chrome 作为我的浏览器。 When I make changes to my application's .css file inside of Visual Studio and save, refreshing the page will not load with the updated change in my .css file.当我在 Visual Studio 中更改我的应用程序的 .css 文件并保存时,刷新页面不会加载我的 .css 文件中的更新更改。 I think the .css file is still cached.我认为 .css 文件仍然被缓存。

I have tried:我努力了:

  1. CTRL / F5 CTRL / F5
  2. In Visual Studio 2012, Go to project properties, Web tab Choose Start External Program in the Start Action section Paste or browse to the path for Google Chrome (Mine is C:\\Users\\xxx\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe) In the Command line arguments box put -incognito在 Visual Studio 2012 中,转到项目属性,Web 选项卡在启动操作部分选择启动外部程序 粘贴或浏览到 Google Chrome 的路径(我的是 C:\\Users\\xxx\\AppData\\Local\\Google\\Chrome\\Application\\ chrome.exe) 在命令行参数框中输入 -incognito
  3. Used the Chrome developer tools, click on the "gear" icon, checked "Disable Cache."使用Chrome开发者工具,点击“齿轮”图标,勾选“禁用缓存”。

Nothing seems to work unless I manually stop debugging, (close out of Chrome), restart the application (in debug).除非我手动停止调试,(关闭 Chrome),重新启动应用程序(在调试中),否则似乎什么都不起作用。

Is there any way to force Chrome to always reload all css changes and reload the .css file?有什么方法可以强制 Chrome 始终重新加载所有 css 更改并重新加载 .css 文件?

Update:更新:
1. In-line style changes in my .aspx file are picked up when I refresh. 1. 刷新时会拾取 .aspx 文件中的内嵌样式更改。 But changes in a .css file does not.但是 .css 文件中的更改不会。 2. It is an ASP.NET MVC4 app so I click on a hyperlink, which does a GET. 2. 它是一个 ASP.NET MVC4 应用程序,所以我单击一个超链接,它执行 GET。 Doing that, I don't see a new request for the stylesheet.这样做,我没有看到对样式表的新请求。 But clicking F5, the .css file is reloaded and the Status code (on the network tab) is 200.但是点击 F5,.css 文件被重新加载并且状态代码(在网络选项卡上)是 200。


解决方案:

参考一: https://en.stackoom.com/question/13IUC
参考二: https://stackoom.com/question/13IUC
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章