使用Asp.Net 5进行实时重新加载

前端之家收集整理的这篇文章主要介绍了使用Asp.Net 5进行实时重新加载前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在Asp.Net 5中,开发速度更快,因为它在保存时编译.
但我仍然需要手动刷新浏览器.

Visual Studio中是否有实时重新加载选项,还是应该使用gulp插件

解决方法

您可以启用BrowserLink并在编辑代码时按Ctrl Alt Enter以使浏览器自动刷新.或者,您可以点击Visual Studio工具栏中的浏览器链接刷新按钮.
  1. public void Configure(IApplicationBuilder application)
  2. {
  3. // Only enable browser link if IHostingEnvironment says it's
  4. // running in Development.
  5. if (this.hostingEnvironment.IsDevelopment())
  6. {
  7. // Allow updates to your files in Visual Studio to be shown in
  8. // the browser. You can use the Refresh
  9. // browser link button in the Visual Studio toolbar or Ctrl+Alt+Enter
  10. // to refresh the browser.
  11.  
  12. application.UseBrowserLink();
  13. }
  14. // Omitted...
  15. }

您还需要在project.json中添加Browser Link NuGet包:

  1. "dependencies": {
  2. "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta7",// Omitted...
  3. }

猜你在找的asp.Net相关文章