6 ms·
But why? ASP.NET Core is one of the best web frameworks, extremely modular and flexible. It's low level components (http server, routing) can be used as a foun
by andix 1y ago
But why?
ASP.NET Core is one of the best web frameworks, extremely modular and flexible. It's low level components (http server, routing) can be used as a foundation for new web frameworks.
- taspeotis 1y agoI agree that ASP.NET Core is fantastic and it doesn’t give you many reasons to look elsewhere. That said I think some diversity / competition / cross-pollination should be welcomed in the .NET space. Not a fair comparison but I’m glad Avalonia exists despite WPF, for example.
- nirav72 1y agoI was wondering samething. But then I saw that it has some built-in capabilities for WebSockets and OpenTelemetry.
- doubleorseven 1y agoseems like the author didn't like the obvious or alternative solutions out there, and went and created one of his own. i know some people who use their own web server, this is an on going adventure for sure.
- whoknowsidont 1y ago>ASP.NET Core is one of the best web frameworks ...based on what?
- andix 1y agoIn total. Just compare different web frameworks by performance, flexibility, features and so on. Whatever you compare, ASP.NET Core will probably end up in the top 20%.
- beanjuiceII 1y agocrazy how people just dont want to believe it, but its really really good
- thewebguyd 1y agoPeople (particularly, HN) still associate it with the old .NET framework days and it being tied to Microsoft, Windows Server, etc. .NET has had a hard time shaking off that old stigma, and to be fair, by the time it was really good, a lot of places already moved on to other tech (in particular, Go) .NET missed its window to escape the enterprise and despite being great, will probably never be seen as sexy. I love it though. It's by far one of the most productive frameworks, and C# is pleasant to work with, and F# even more so.
- whoknowsidont 1y agoNope. I see this deflection attempt all the time. Plenty well versed in both old and new .NET.
- whoknowsidont 1y agoYeah it's lived experience vs perception for me. .NET developers have always, ALWAYS loved to tout how great things are but there's a reason anyone even slightly outside the MS-sphere simply chooses not to use it. Because it's not that great, really. The performance isn't that great in real-world scenarios (remember when they had to lie, in that "one" incident)? Even today the tests look NOTHING like actual idiomiatic .NET code. Secondly, .NET developers tend to target a particular set of DevEx that I don't personally understand but that's not the problem, the problem is the DevEx has end-user effects; they simply just don't give a shit. Anything past a simple B2B crud app in .NET is basically an uphill battle in real companies. It never works out, it's always more complicated than it needs to be. But hey, no one gets fired for choosing MS. So here we are. If you drop the religious zealotry, there's simply not a lot left.
- sltr 1y agoThe library's tagline says "Powerfully Simple. Blazingly Fast." So there. ::folds arms:: Joking aside, I do agree that ASP.NET Core is a behemoth. On .NET 9, I just now did `dotnet new webapi` followed by `dotnet publish --self-contained -p:PublishSingleFile=true` and the binary is 103MB. That would blow up the size of a mobile app considerably, just to listen to HTTP. There a separate use case that SimpleW won't solve: When you're on a platform that .NET Core doesn't support, like Raspberry Pi Zero (armv7l). In this case all you have is the mono framework and binding to raw ports.
- zigzag312 1y agoEnable trimming
- mlhpdx 1y agoAnd AoT.
- sltr 1y agoSimple claim with a complex story. I thought about mentioning AOT and trimming, but my comment was already long. AOT in ASP.NET is still a moonshot in most cases, and a non-starter in existing web apps due to dependencies not supporting AOT. Worth mentioning that as of .NET 9 AOT is not supported on Android.
- actionfromafar 1y agoSoo many dependencies do not support AOT.
- crinkly 1y agoSometimes. It's usually a lot bigger than that the moment you pull in any simple dependencies. Also the CLR memory overhead is horrible. Our .Net guys have serious problems with startup time (JIT) and initialy latency on .Net Core so I don't trust the fast claim. And no you can't just AOT everything. We moved a couple of critical services over to Go because of those two issues and it turned a few heads.
- brainzap 1y agono its not. We always can use alternatives
- prodbro 1y agoauthor here. I wanted to start with something small where I could read or write the code in a reasonable amount of time. My usage was, and still is, for low traffic. I don't intend to replace the Kestrel beast. Just a framework you can quickly understand without being lost in documentation once you want to custom a part.
- prodbro 1y ago> ASP.NET Core is one of the best web frameworks I don't think so. The fact is there are very few dotnet web servers. ASP.NET Core is supported by the owner of the dotnet langage who is also the M of the GAFAM. There is some place in the ecosystem for other alternatives
- stackskipton 1y ago>The fact is there are very few dotnet web servers. SRE here, very few because Microsoft is strongly opinionated with ASP.Net and those opinions most sense for VAST majority of their users.
- prodbro 1y ago> those opinions most sense for VAST majority of their users I have a much more nuanced view. I think that ASP.Net is the de facto standard for being backed by Microsoft since many years. From the gold time when ASP means IIS to now when Kestrel was cannibalized by Microsoft. As a developer, working with the most widely used stack guarantees that these choices won’t be questioned in critical situations. I’m not saying Kestrel is bad, but it doesn’t automatically fit every scenario. - 15 years ago, there were Apache or IIS. - Then nginx changes the game and kicks their ass - Then webserver starts being written into script langage for better integration (Ruby, Python), no more CGI and nginx as reverse - Then node changes the game - Now : caddy and other alternatives... but still not web server in PHP (troll inside) I see a pattern to not believe aspnetcore is the only one and the best.
- tracker1 1y agoThe webserver variability isn't really so wide because the in the box offering since Core has been pretty good, flexible and works for most use cases. And while I really like FastEndpoints a lot over the minimal api stuff, even that is pretty straight forward. It's not my favorite, it starts slow and I'd rather go up to JS/TS for scripting flexibility or down to Rust for really lightweight performance with fast startups. It's one of the better all-around options though. I'd rather use it over Java every day of the week and there are adapters for most things you'd ever need to communicate with.
- oakstendheim 1y agoOne of the use cases that stands out to me is dropping an API into a console application without having to use a different project. With ASP.NET I have to set up a new project, use a different SDK and then re-register all my services in its service collection. It looks like this one is bringing it closer to how it's done in Go which I personally really like.
- kuhsaft 1y agoYou shouldn't have to change the SDK. You can create a class library ASP.NET Core Server by using a FrameworkReference [1]. I can't remember the library, but there was one that had its own `IHostedService` with its own embedded ASP.NET Core Server startup within it. If your `WebApplication` requires services, of course you're going to have to register its dependencies on its `IServiceCollection`. Though, you can use factory methods for service registration to use an external `IServiceProvider`. For console applications, I would recommend using `Host.CreateEmptyApplicationBuilder` [2]. Makes it a lot easier to configure services for Console applications. It also handles `IHostApplicationLifetime`s. [1] https://learn.microsoft.com/en-us/aspnet/core/fundamentals/target-aspnetcore?view=aspnetcore-9.0&tabs=visual-studio https://learn.microsoft.com/en-us/aspnet/core/fundamentals/t... [2] https://gist.github.com/pethin/7e5edd7614ff2f51c06c086e1bc7cc44 https://gist.github.com/pethin/7e5edd7614ff2f51c06c086e1bc7c...
- oakstendheim 1y agoWow I did not know that, I was always under the assumption that I needed to have a project using the Microsoft.NET.Sdk.Web for anything Web as its base. Thanks for the info!
- andix 1y agoIt used to be much more modular back in dotnet core 2.x. It was just too complex for most people to wire up everything themselves. You needed to install a lot of nuget packages, add a lot of middlewares. In the end 95% of the projects added everything anyway, but always with some little mistakes and weird errors. Starting with 3.0 (or 5.0?) they ditched the Startup class and just added in everything by default. Much easier for the regular web application. The modular approach is still everywhere though. You can just pick the components you need, most of them also run without DI, it's just a bit of a hassle to manage all those dependencies manually.
- louthy 1y ago> ASP.NET Core is one of the best web frameworks In your opinion. Not everyone is of the same mind when it comes to software design. Sometimes the motivations are different. As a community we should encourage those looking to find their own path. We become myopic otherwise.
- andix 1y agoYes, in my opinion. But also objectively it's really good for many things. That's the reason I asked the question "why?". It's probably much slower (asp.net got performance/memory optimized to a ridiculous extent), and might contain dangerous vulnerabilities (creating a secure http server is hard!).