Replies: 3 comments 3 replies
-
Hello @ITESMEDIA,
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;
var builder = Host.CreateDefaultBuilder()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseKestrel()
.UseUrls("http://localhost:5000")
.Configure(app =>
{
app.UseStaticFiles();
});
});
await builder.Build().RunAsync(); |
Beta Was this translation helpful? Give feedback.
-
Well Kestrel is a full flegded server. When it's really just something simple needed, as alluded by (at least what I interpret)
then a simple implemenation based on HttpListener could also work. Out of curiosity, can you eloberate more no
i.e. why this is needed? |
Beta Was this translation helpful? Give feedback.
-
For now we ended up replicating what a self-contained app does, but we only include the ASPNET.Core DLL files from the binary distribution and not the entire framework. It helps not to increase the filesize too much while not requiring to deploy all of our apps from that packages as self-contained (which could cause a lot of duplicate files). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
We have a desktop app that has a small need to run a local HTTP server to serve some files, we would like to use the latest version of Kestrel to do this but I don't believe that Kestrel is still distributed as Nuget packages anymore.
We have added the FrameworkReference Microsoft.AspNetCore.App to our project but now running our app requires both the Desktop runtime and the ASP.NET runtime, which is not ideal.
Any suggestions on how we could ship the Kestrel assemblies as part of our app? Are we looking for trouble by attempting this?
We would like to avoid self-contained deployment for now for other reasons.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions