Visual Studio 的 Browser link
在VS 2013以後,有個類似LiveReload的功能叫Browser Link
可以即時編輯,甚至跟瀏覽器同步
看著文章試半天,一直跑不出來。
後來發現原來是web.config有些部份沒設定好
要設成下面這樣:
微軟的說明也沒說要注意runAllManagedModulesForAllRequests="true"
關於runAllManagedModulesForAllRequests的原理,可以看保哥這篇
ASP.NET MVC 4 在 .NET 4.0 與 .NET 4.5 的專案範本差異
測試完成,可以用visual studio 輕鬆即改即看囉!
可以即時編輯,甚至跟瀏覽器同步
看著文章試半天,一直跑不出來。
後來發現原來是web.config有些部份沒設定好
要設成下面這樣:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<system.webServer> | |
<handlers> | |
<add name="Browser Link for HTML" path="*.html" verb="*" | |
type="System.Web.StaticFileHandler, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" | |
resourceType="File" preCondition="integratedMode" /> | |
</handlers> | |
<modules runAllManagedModulesForAllRequests="true"> | |
</modules> | |
</system.webServer> |
微軟的說明也沒說要注意runAllManagedModulesForAllRequests="true"
關於runAllManagedModulesForAllRequests的原理,可以看保哥這篇
ASP.NET MVC 4 在 .NET 4.0 與 .NET 4.5 的專案範本差異
測試完成,可以用visual studio 輕鬆即改即看囉!

留言