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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章