Live data from Hacker News

.NET 5.0

devblogs.microsoft.com

101–110 of 466 posts

Re: .NET 5.0

#101
post #59

Earlier quoted context omitted.

You can do that just with different config files or env vars too. No need to complicate code for stuff that can be done easily differently as well.

And then you realize that it's 2020 and you don't want configuration files, you want environment variables. Or, now that you've hardstuck yourself on environment variables and built all this stuff around them to set and re-set them properly between tests (now running either in multi-process, which good luck in most environments, or are just running in serial ), you're using k8s and the voluming of secrets rather than…

[deleted]

Re: .NET 5.0

#102

Earlier quoted context omitted.

>and you're in for an even bigger nightmare if you want to separate business logic and web code into two projects (which is a pretty common design). I've given up with the config DI and just assign them all to static variables. So you have static variable in web project and then add reference to web project to obtain that config? Do I get that right? I never felt like config DI was a problem once you did all the stuf…

To me it's just so pointless, here's an example: using Microsoft.Extensions.Configuration; //extra line using Microsoft.Extensions.Options; //extra line public class AdminController : Controller { IOptions settings; //extra line public AdminController(IOptions settings) //extra code { this.settings = settings; //extra line } public void RandomMethod() { var a = settings.Value.FinallyMySetting; // 5 extra lines to acc…

I agree that there's a bit of boilerplate, but in this case it's boilerplate that's normally already handled when you're using GenericHost or WebHost builders - which will setup all this Configuration, Logging and Dependency Injection for you (take a look here for an example https://dfederm.com/building-a-console-app-with-.net-generic...). I don't know what kind of console apps you're writing, but if they require DI and environment-specific configuration files then you'd likely be better off using GenericHost. Setting all this up by hand is a bit cumbersome, but I don't think they were really intended to be used that way.

Re: .NET 5.0

#103

Earlier quoted context omitted.

>and you're in for an even bigger nightmare if you want to separate business logic and web code into two projects (which is a pretty common design). I've given up with the config DI and just assign them all to static variables. So you have static variable in web project and then add reference to web project to obtain that config? Do I get that right? I never felt like config DI was a problem once you did all the stuf…

To me it's just so pointless, here's an example: using Microsoft.Extensions.Configuration; //extra line using Microsoft.Extensions.Options; //extra line public class AdminController : Controller { IOptions settings; //extra line public AdminController(IOptions settings) //extra code { this.settings = settings; //extra line } public void RandomMethod() { var a = settings.Value.FinallyMySetting; // 5 extra lines to acc…

I'm mainly interested in one statement:

> it's just pointless boilerplate trash, which C# has been getting rid of excellently

Could you elaborate on how you feel C# avoided this?

From my point of view the only alternative (to DI with constructor injection) is static members somewhere, which does not scale. Maybe property injection, but ugh.

Re: .NET 5.0

#106

> 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…

> From the previous version of .Net Core only.

Which is already three major versions ahead off classic .net.

You’re literally complaining about making upgrades past four major releases not being drop-in compatible.

Can you show any other stack which has made such strides to modernise and maintain better compatibility?

Re: .NET 5.0

#107

> It’s already in active use by teams at Microsoft and other companies... This means nothing anymore. MSFT says that about everything they release and users are still often left with the feeling that they are guinea pigs testing a very unfinished product. > For Visual Studio users, you need Visual Studio 16.8 or later to use .NET 5.0 on Windows and the latest version of Visual Studio for Mac) on macOS. The C# extensi…

> This means nothing anymore. MSFT says that about everything they release and users are still often left with the feeling that they are guinea pigs testing a very unfinished product.

There is some truth to this but when it comes to the core .NET stuff that is pretty solid. However .NET core before version 2.0 was mess.

> Reading this makes me wonder who is still using Visual Studio. That IDE is so bad it's beyond believe.

That is your opinion man. Personally I really like VS.

> Why the hell do Windows developers need to install an entire new IDE in order to use the latest version of the .NET runtime? It's ridiculous beyond belief.

They aren't installing a whole IDE. It is an update to the existing VS 2019 version. The newest version of the IDE (which is 16.8) has support .NET 5.0. The vast majority of people that are using .NET core are using the latest Visual Studio 2019 already and this is a minor update (it takes maybe 10-20 minutes to install, so run the updater make a coffee and time you come back you should be good to go).

> Really shows that Visual Studio Code is the future. All you have to do is install the latest runtime and update the plugin so it shows you suggestions for all the latest language features. No need to install a new version of Visual Studio Code itself.

VS code and other alternative .NET IDEs doesn't support many of the things that are typically used around the .NET world e.g. SQL database projects don't work in Rider or VS Code (I just tried it with Rider) and I suspect that a lot of the tooling around that doesn't work. There probably a load of other stuff (that I don't use) that doesn't work either.

It really depends what you are doing.

> This might cause confusion. .NET 5 is basically .NET Core 3.2 but has been renamed to .NET 5 so that .NET Framework 4.x users can finally get convinced to move to .NET Core. They just dropped the Core to make it look more appealing to them, but it's still .NET Core.

I know a lot of people that don't work with Microsoft tech think we are all dumb but we aren't all that dumb. Moving projects from .NET Fullfat to .NET Core maybe a large undertaking (depending on the project) depending on how the project is strutured and what tech it uses.

Re: .NET 5.0

#108
post #29

Earlier quoted context omitted.

I found Go to be a really nice replacement for C#. It has the static typing and garbage collection, but you also get a self-contained binary executing without the requirement of an external runtime environment. I also discovered that I don't miss classes at all.

>but you also get a self-contained binary executing without the requirement of an external runtime environment. I'm not sure whether we're talking about the same thing, but you can publish Self-Contained App (basically your app and framework together) and you don't have to install anything.

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

Re: .NET 5.0

#109

Earlier quoted context omitted.

>and you're in for an even bigger nightmare if you want to separate business logic and web code into two projects (which is a pretty common design). I've given up with the config DI and just assign them all to static variables. So you have static variable in web project and then add reference to web project to obtain that config? Do I get that right? I never felt like config DI was a problem once you did all the stuf…

To me it's just so pointless, here's an example: using Microsoft.Extensions.Configuration; //extra line using Microsoft.Extensions.Options; //extra line public class AdminController : Controller { IOptions settings; //extra line public AdminController(IOptions settings) //extra code { this.settings = settings; //extra line } public void RandomMethod() { var a = settings.Value.FinallyMySetting; // 5 extra lines to acc…

You don't need to inject IOptions, you can inject the Settings class directly. I don't see an issue with those extra lines, VS generates them with one hotkey for me.

Re: .NET 5.0

#110
post #41

> It’s already in active use by teams at Microsoft and other companies... This means nothing anymore. MSFT says that about everything they release and users are still often left with the feeling that they are guinea pigs testing a very unfinished product. > For Visual Studio users, you need Visual Studio 16.8 or later to use .NET 5.0 on Windows and the latest version of Visual Studio for Mac) on macOS. The C# extensi…

I use Rider now, VS got to the point of being so slow that frequently I'd have to wait 0.5 seconds for each character I was typing to appear. The performance is utterly, utterly terrible. Yet, all I see from the VS team on Twitter is "look at this new useless feature we've added", when all I needed was for the code I'm typing to appear. God help you if you ever wanted to rename a symbol, it was Schrodinger's rename,…

Actually Visual Studio is quite fast again. It's just that Resharper does its very best to slow it down. I don't believe this will ever change. Well except maybe Microsoft will fully deprecate COM-based in-process extensions.
Post reply on HN