如何在ASP.NET 5中为静态文件启用浏览器链接 [英] How to enable browser link for static files in ASP.NET 5

查看:191
本文介绍了如何在ASP.NET 5中为静态文件启用浏览器链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以使Browser Link在ASP.NET 5下使用静态文件?我的Startup.cs当前具有以下内容:

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
    });
}

显然不足以解决问题.我正在运行VS 2015 CTP 6.

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

以前在System.Web下,可以通过为.html文件设置处理程序来实现,例如在此答案中,但是我不确定ASP.NET 5的等效版本.

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.

也有人在 ASP上发布了问题. .NET论坛,但到目前为止还没有答案.

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

推荐答案

到目前为止,在已发布的CTP中,ASP.NET 5的Browser Link对静态文件的支持不佳,因为Browser Link核心需要更多内容.在新框架中致力于处理静态文件处理方面的优化.在更高版本的Visual Studio中将完全支持此方案.

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.

这篇关于如何在ASP.NET 5中为静态文件启用浏览器链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆