Using Latest C# Features in Any Old .NET Version

preview_player
Показать описание


Hello everybody I'm Nick and in this video I will show you how you can use the latest C# 11 in your old codebases such as .NET Framework or UWP.

Don't forget to comment, like and subscribe :)

Social Media:

#csharp #dotnet
Рекомендации по теме
Комментарии
Автор

I love this package. Most of the apps I maintain are stuck at framework 4.8 and will likely never move to anything derived from Core, so this is very handy. I'm OK with not having new language features that require CLR changes, but language features that are purely compiler and library changes should be available on all platforms and I will definitely use them. Makes moving back & forth between framework and core so much less painful.

carldaniel
Автор

You almost made 1st place on my "top 3 mind blown moments this week", but a few days ago I learned that if you add a Select method to any class, you can use it in LINQ Query Syntax and my head exploded

wojciechwilimowski
Автор

Amazing! just what I was looking for.
After working a a project with .Net6 it feels a bit bitter to work in .Net Framework 4.7.
This will really help.

drm
Автор

That's exactly what I needed, without knowing that I needed it. Thanks a lot, Nick!

MAO-szwr
Автор

That depends on the compiler installed on your machine. If you make these changes and a colleague of yours doesn't have the correct compiler, it could be a problem.

lucvolts
Автор

5:06 instructions unclear typed source...net, website not found

quelqunderandom
Автор

I didn't know about this package. I used another package Nullable package to support nullable annotations, but this goes beyond that. Will be updating my project to use this.

astralpowers
Автор

This library is awesome, I was really handy for me today. Never knew before it

antonmartyniuk
Автор

How did you get that timing so well? I was just using C#11 in .NETStandard2.0 and got stuck on list patterns. I took a break and here is the exact video I needed. Thank you! (Also shout out to PolySharp)

zwatotem
Автор

I use IsExternalInit in order to have a record in MobileDeviceSharp one of my C# library (because I want to be backward compatible to NET Standard 2) but maybe I can switch to this solution ! Thanks you Nick !

mickaelveril
Автор

I heard about this about a month ago and replaced `IsExternalInit` and `Nullable` on the project I'm working on at work. Finally being able to use required 👏

modernkennnern
Автор

It's worth bumping the C# version anyway.
While there are some that depend on these stubs, and others that require runtime changes, there are also many features that require neither.

billybob
Автор

Very cool

It's still something I wish was just supported out of the box, though

computer
Автор

Thank you for this knowledge! I was just wishing the other day to be able to do exactly that. You saved my sanity!

Gargo
Автор

This is perfect, exactly what i just needed now. Thank you

cn-ml
Автор

Wow thats new for me, i knew you could change the language version - but i always got that those errors you are talking about. Great that there is a way to solve that ;-)
Really thanks for getting that out!

Fnalspace
Автор

Thanks a lot for this very practical tip!! Indeed I didn't know about this single and so complete dedicated package. (Still need to support a lot of hybrid old and modern projects at work)
I have been using individual packages instead like IndexRange and searched samples of those manual code fixes including that IsExternalInit one.
Though it's strange but kind of an exception to the rule seems the System.Memory package from microsoft itself that gives kind of official backwards compatibility support for older versions to be able to use Span and Memory, even though it's not really mentioned in their documentation.

jongeduard
Автор

Thanks for another great video, haven't tried it yet but seems like a life saver for source generators as they are stuck on standard 2.0 if I remember correctly.

Petoj
Автор

How does the performance look here then? Is it worse or the same compared to the .Net version that has official support for this?

ROBdk
Автор

I did the trick for init only setters but in Unity, which is stuck on a incomplete C# 9 implementation and dotnet 4.x I think.

soverain
welcome to shbcf.ru