Hacker News new | ask | show | jobs
by bragh 462 days ago
How do you deploy your code with Kestrel though? If you already have Windows Server licensed, then you get IIS and msdeploy without any additional tooling or vendor needed.
3 comments

The self-contained deployment piece helps with that.

I've built pipelines where the deployed code is responsible for cloning, building & redeploying itself based upon commands sent via an administration interface. The .NET SDK is relatively lightweight and can be included as a management component in a broader B2B/SaaS product.

It's better to use the same deployment process you would use for Node.js, Go, Rust, etc. Especially since .NET CLI tooling is excellent and lets you build fairly small completely self-contained binaries (with trimming) or you could easily get your hosts to have the runtime installed (which takes little space) and then just copy very small .dll files (you can do runtime-less single-file deployment, so it's going to be literally 1-5 files taking less than 1-5MB in total).
Add the executable as a windows service, stop service, replace executable (SMB copy or rsync or whatever), start service?

Probably a cleaner way, but it’s just a exe, so replace it like a exe?

While you can do that, you lose the flexibility of IIS without a lot of infrastructure development should you not just want a single website per server running .NET only.

Kestrel is fast, though.

Yes, that is obvious, but the problem is that this requires some account to have permissions to start and stop services and to execute commands on the target host. Corporate IT departments are not too happy with that kind of approach nowadays.