Live data from Hacker News

.NET 5.0

devblogs.microsoft.com

261–270 of 466 posts

Re: .NET 5.0

#261

So, on the plus side with the new .net, I recently made a .net core web app on Linux, and generally it's been pretty easy. I'm also impressed at just how fast asp.net core is compared to asp.net, the time it takes to open your site in debug mode has dropped dramatically, from what used to be 1/2 minute in asp.net to a few seconds in .net core. On the bad side? Mainly the asp.net core team and their push for Dependenc…

The async stuff may require some attention, but it's part of the performance story when dealing with many requests, not when evaluating just one.

As regards configuration, all the means you could want for configuration are there. You can access items directly [1], or via strongly typed objects. These all support multiple sources of configuration data, and many means of overriding them.

I generally really don't like environment variables as they expose configured secrets to everything in the same machine / container, but we make use of the standard configuration system's environment variable overrides, but we use akv2k8s.io and thus only expose secrets to the container's entry point application.

[1] public Startup(IConfiguration config) { // injects config store var setting = config["yourConfigKey"] // ... but you now have to convert this from a string for any other datatype }

Re: .NET 5.0

#262

So, on the plus side with the new .net, I recently made a .net core web app on Linux, and generally it's been pretty easy. I'm also impressed at just how fast asp.net core is compared to asp.net, the time it takes to open your site in debug mode has dropped dramatically, from what used to be 1/2 minute in asp.net to a few seconds in .net core. On the bad side? Mainly the asp.net core team and their push for Dependenc…

I agree. The first thing I always do is make a custom Settings class which just loads settings via good old `Environment.GetEnvironmentVariable`. Super simple and never failed me. Bonus Points, by loading all settings at once into strongly typed properties at startup, it will fail fast if a setting is missing, which to me is a benefit. But I still pass this class via DI to the controllers for testability reasons. If…

> make a custom Settings class class which just loads settings via good old `Environment.GetEnvironmentVariable

Why would you prefer that, to the the built-in classes to load settings via good old environment variables, among other sources? Which do you think new people coming to your team would prefer to see?

Re: .NET 5.0

#263
Maybe in a year or eighteen months, I'll be able to move to this, from Framework code that still has dependencies that nobody has ever updated to .NET Core.

This version will be nearly out of support by then...

Re: .NET 5.0

#264
post #209

Earlier quoted context omitted.

Async means non-blocking, not parallel. It helps keep the app responsive while using less resources and avoiding lockups and crashes. .NET is used by millions of developers. Strong and scalable foundations matter, and performance is an explicit goal with asp.net being one of the fastest web frameworks. Async is a core part of this. There's very little - if any - overhead that you need to worry about with async code f…

> It helps keep the app responsive while using less resources and avoiding lockups and crashes. it actually uses more resources. async has a cost, but it is really low.

There is a resource tradeoff. async/await has a minor CPU/memory impact, but it can also free up threads to do other work during an I/O bound operation.

Threads have their own resource cost.

Re: .NET 5.0

#265

Earlier quoted context omitted.

This is technically true, but it's a difference of a 5 MB executable vs a 50 MB.

Is it, actually? I mean, yes of course its 45MB difference, but does this matter? We are not talking about applications downloaded to a browser (webapp) or to a mobile phone. In a time where I download >50GB+ games on Steam and deploy from CI/CD server or docker registries to my servers, is a size of 50MB or 100MB really a showstopper? Don't get me wrong, I totally love 4k and 64k demos and am always fascinated what…

The only environments where self-contained deployment matters are the ones you mentioned: browser, mobile phone, and also desktop. So yes, 45mb is a big difference (actually my app is 250mb).

Re: .NET 5.0

#266

Earlier quoted context omitted.

> My biggest bugbear is the way you access your config, which is an absolute and utter kafka-esque mess. Because someone at MS was drinking the DI kool-aid you have to add a minimum of 5 lines of code to any class you want to access config values in I'm not sure if maybe you're referring to the Options stuff? The way I do it is pretty simple. 1. Create a POCO that represents your config. You can have properties for b…

For other people who are curious POCO stands for "Plain Old CLR Object" So I think just a basic uninhereted object.

Typically also implies that the object contains no real logic/functionality and is a simple container for storing some values. Something that could be a record type.

Re: .NET 5.0

#267
post #230

Earlier quoted context omitted.

It also means that the first major vulnerability in .NET Core will be an unmitigated clusterfuck, as admins will have no automated tooling in place to update .NET Core with security patches. "Just recompile with the new version!" I hear the cries already, said by people that have never had to support literally a thousand applications in a government data centre, half of which were built years ago by a vendor that is…

Publish your apps without .net core (--no-self-contained) and install/manage runtimes as you usually would. If you have thousand apps, you probably also have a CI/CD system and you can gain fine grained control on your runtime management needs with .net build/publish. MS does quite a few things poorly but they have done a solid job of operating in large enterprises.

"Publish your apps" isn't the issue: I support a lot of applications I don't build or have the source code for. And they may be on my network for over ten years.

The problem is if developers are publishing self-contained apps with .NET Core, IT staff will be up a creek on vulnerability mitigation. While being able to pin specific .NET Core versions is nice for developers, being able to require the most current .NET Core version be used is important for IT staff who have to support these applications.

Re: .NET 5.0

#268

So, on the plus side with the new .net, I recently made a .net core web app on Linux, and generally it's been pretty easy. I'm also impressed at just how fast asp.net core is compared to asp.net, the time it takes to open your site in debug mode has dropped dramatically, from what used to be 1/2 minute in asp.net to a few seconds in .net core. On the bad side? Mainly the asp.net core team and their push for Dependenc…

I can get behind the DI dislike, but how are callbacks and promises in nodejs better than async in .NET?

What’s not to like about DI? Makes it so much easier to wire up dependent services and refactor those wirings at a later time. If you don’t use DI you have to manually manage everything yourself.

Re: .NET 5.0

#269

> From what we’ve seen and heard so far, .NET 5.0 delivers significant value without much effort to upgrade. From the previous version of .Net Core only. They've done absolutely nothing to make migrating from MVC 5 any easier, while proclaiming that this somehow merges .Net Framework and .Net Core. Going from MVC 5 to .Net 5.0 MVC is a complete re-write of the web layer from an empty project upon up (even according t…

We did the migration off ASP.NET a couple years ago. Our site wasnt that big, but we had some major anti-patterns that we decided to address during the migration. (we had multiple CSPROJs for "Businsess Logic" and "Data Access Layer" that didnt do anything of value, end effect was simpler code an ~70% less LOC) There were a few major design changes that we had to embrace in the migration, mainly the middleware and DI…

Out of curiosity, why is your site using .NET instead of a modern framework in NodeJs or Python?

Re: .NET 5.0

#270

Earlier quoted context omitted.

The idea is that its installed separately from windows, in the same way one might install java. So because you can have mutiple versions installed, or you can package it with an app , then the updates can be more rapid. The problem with .Net framework is that everything, including system services rely on it - that means it needs years of testing and can't have any breaking changes. Basically they decided that packagi…

I feel their mistake was not allowing apps to call a specific version if needbe, not with the general decision to include it in Windows. While .NET Framework updates annoyingly force every app to use it, I expect .NET Core to make it super difficult to secure apps that decided to hardcode some specific ancient release of it and allow no way to override it.

.NET Framework was built to support and did allow systems to have multiple versions installed side-by-side and apps to call specific Framework versions and was built to support many versions side-by-side. But that turned out to be more difficult in practice than in theory. Multiple side-by-side Frameworks turned out to be more hassle than useful, and even with just 3 versions of the Framework that were built to live side-by-side (1.x, 2.x, sort of 4.x, long story) that was often pointed to as a source of bloat in Windows.

The mistake to include it in Windows was partly why more versions weren't made (because then they'd have to be serviced for the length of a Windows version's service lifetime; because then they'd contribute way more to Windows bloat).

Post reply on HN