3 ms·
Can you produce a stand alone executable with ASP.NET these days? I had a look at how to deploy a modern ASP.NET thingee the other day and it was super enterpr
by LAC-Tech 5y ago
Can you produce a stand alone executable with ASP.NET these days?
I had a look at how to deploy a modern ASP.NET thingee the other day and it was super enterprisey. It doesn't produce a single file, it produces a 'publish' folder, and you need something called a "kestrel" server...
Say what you will about node.js but you just run the script and slap caddy or nginx in-front of it.
- DoctorOW 5y agoYes and no. You can publish a single binary but all those assets are just embedded inside it so the file is pretty large compared to everything else.[0] Also Kestrel is built into ASP.net, not something that needs setup.[1] You can slap Caddy or Nginx in front of a .NET program just as easily as anything else. [0]: https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file/overview https://docs.microsoft.com/en-us/dotnet/core/deploying/singl... [1]: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-6.0 https://docs.microsoft.com/en-us/aspnet/core/fundamentals/se...
- Merad 5y agoKestrel is the web server that Asp.Net Core runs on by default. It's part of the application. Building an app that has the runtime bundled with it (no need to install .Net) or a single file executable is just a matter of setting a few build flags.
- kumarvvr 5y agoYes. You can create a kestrel server based web app, and simply run it, for use in localhost. Adding an nginx as a proxy is also simple. Nothing enterprisey about it. Also, the "Publish" folder is basically the "build" folders you get from other stacks.
- ledgerdev 5y agoYes, but it will be large, ~40mb zipped. Net6 release broke trimming (tree shaking) with entity framework at least which caused an app of mine to balloon quite a bit. Native AOT is on the roadmap for net7 which is good but very minimal support. For instance asp.net mvc is a non-goal (https://github.com/dotnet/runtime/issues/61231 https://github.com/dotnet/runtime/issues/61231), so probably another 3 or 4 years before it's well supported.