Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.Net Core 1.0 (aka Asp.Net 5) website refresh with any file change?

Looking for a similar functionality like browsersync give for Node applications to auto reload browser with any file change.

Running Asp.Net Core (aka Asp.net 5) with dnx-watch and it restarts the Kestrel web server with any C# code change, but still have to refresh browser manually to see the changes whether its client or server file changes. Using Gulp for build pipeline and thinking of using it to do both dnx-watch and reload browser, but cannot find any example online.

Love to have some help on this.

Thanks

like image 704
Nexus23 Avatar asked Mar 09 '16 17:03

Nexus23


People also ask

What is the difference between .NET Core 3.1 and .NET 5?

NET 5 is a free, cross-platform, open-source developer platform for building many different types of applications. . NET 5 is the next major release after . Net Core 3.1 which was released in June 2016. The word 'Core' is dropped from the name to emphasize that .

What is the difference between .NET 5 and .NET 6?

NET 5 and . NET 6 are supported on multiple operating systems, including Windows, Linux, Android, iOS /tvOS, and macOS. The only difference is that . NET 6 is further supported on Windows Arms64 and macOS Apple Silicon while .

How do I refresh the page in asp net?

Write("<script type='text/javascript'> setTimeout('location. reload(true); ', timeout);</script>"); Put the above code in button click event or anywhere you want to force page refresh. Save this answer.


2 Answers

There's no official support for your scenario, sorry!

However, it's interesting and I would like to have it at least on the backlog. Can you please open a request at https://github.com/aspnet/dotnet-watch ?

like image 62
Victor Hurdugaci Avatar answered Sep 30 '22 23:09

Victor Hurdugaci


1) It is possible to just use gulp and browsersync. It works good and fast, but is a bit tricky because you have to start IIS-Express first and use browsersync in proxymode.

2) A much better solution is the Visual Studio Extension Browser Reload on Save made by Mads Kristensen, a member of the Asp.Net team.

like image 32
Michael A. Volz aka Flynn Avatar answered Sep 30 '22 21:09

Michael A. Volz aka Flynn