Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 925
Kjetil Limkjær Avatar asked Mar 12 '15 13:03

Kjetil Limkjær


People also ask

What is the default directory for static files in ASP.NET Core?

Static files are stored within the project's web root directory. The default directory is {content root}/wwwroot , but it can be changed with the UseWebRoot method.

What is the use of static files?

An important feature nearly every web application needs is the ability to serve up files (static files) from the file system. Static files like JavaScript files, images, CSS files that we have on the file system are the assets that ASP.NET Core application can serve directly to clients.


1 Answers

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.

like image 70
Joe Davis Avatar answered Oct 14 '22 11:10

Joe Davis