How to enable browser link for static files in ASP.NET 5

不打扰是莪最后的温柔 提交于 2019-12-04 08:16:38

问题


Is there a way to get Browser Link working with static files under ASP.NET 5? My Startup.cs currently has the following:

public void Configure(IApplicationBuilder app)
{
    app.UseBrowserLink();
    app.UseStaticFiles();
    app.UseFileServer(new FileServerOptions
    {
        EnableDefaultFiles = true
    });
}

which is apparently not enough to do the trick. I'm running VS 2015 CTP 6.

Previously under System.Web it was possible by setting up a handler for .html files like in this answer, but I'm not sure what the ASP.NET 5 equivalent would be.

Someone has also posted the question at the ASP.NET forums, but it has no answers so far.


回答1:


In the CTPs that have been released so far, static files aren't supported well by Browser Link for ASP.NET 5, because the Browser Link core needs more work to deal with optimizations in static file handling in the new framework. This scenario will be fully supported in a later build of Visual Studio.



来源:https://stackoverflow.com/questions/29011607/how-to-enable-browser-link-for-static-files-in-asp-net-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!