Closed rd-nrg closed 4 years ago
If you want standalone I recommend using the Dotnet Tool (3.0 SDK).
dotnet tool install LiveReloadServer
That'll be a self contained executable you can run from anywhere.
As a console app you'll have a dependency on the ASP.NET Core runtimes - so if you're building a console app you'll need to add the <framework include="AspNet.Core.All" />
reference.
Take a look at the LiveReloadServer
project in this repository - it can run either as a console app or as a dotnet tool - depending on the packaging options.
Thanks for your prompt reply. The LiveReloadServer
is not an option as the cshtml files depend on external class libraries and data within the same solution.
Would you please tell me how to add <framework include="AspNet.Core.All" />
to a .NET Core 3.0 console application?
You need to add <framework include="AspNet.Core.App" />
not .All
in 3.0.
I can attest that that this works. I've build a several tools that rely on the LiveReload middleware and it works great in that integrated scenario. To see how this works look at the dotnet tool implementation and it also compiles to a standalone server.
<Project Sdk="Microsoft.NET.Sdk">
...
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Westwind.AspNetCore.LiveReload" Version="0.1.5.4" />
</ItemGroup>
</Project>
This perfectly works for a standalone web application but not if web application startup is referenced in a console application as a class library.