C
C#14mo ago
Mango

❔ NET 6 breaking changes

Breaking changes in .NET 6
Navigate to the breaking changes in .NET 6.
56 Replies
Mango
MangoOP14mo ago
So binary change means if we still have compiled binaries of it it won’t have the change? I don’t understand under what situation it WILL have a breaking change
jcotton42
jcotton4214mo ago
binary compatible is you take the same binaries compiled for an older version of .net and drop them into a .net 6 project it's not a common situation
Mango
MangoOP14mo ago
Oooooooo So if I have an older version targeting say NET 5 or something, it will work and not have the new behavior
jcotton42
jcotton4214mo ago
if you just take the binaries but you probably shoudln't this is pretty much only for people consuming closed-source 3rd-party deps that haven't recompiled for new runtimes
Mango
MangoOP14mo ago
Let’s take the ActionResult<T> change for example. The old version won’t have the change where it now has 200 as the status code.
jcotton42
jcotton4214mo ago
I simply wouldn't worry about the binary compatibility thing unless you fall into the situation I just described
Mango
MangoOP14mo ago
What about compiles? Compiled
jcotton42
jcotton4214mo ago
you mean source compatible?
Mango
MangoOP14mo ago
Yeah that one
afrazier
afrazier14mo ago
Then you care about source compatibility.
jcotton42
jcotton4214mo ago
then code compiled under .net 6 will have different behavior unless you take the workaround steps outlined (if available)
Mango
MangoOP14mo ago
Also, these changes are only comparing NET 6 to the previous (major?) release? Like NET 5 to NET 6?
jcotton42
jcotton4214mo ago
yes
afrazier
afrazier14mo ago
Correct
Mango
MangoOP14mo ago
So if we migrated from say NET Core 1.1 to NET6
afrazier
afrazier14mo ago
You'd have a lot of release notes to wade through.
jcotton42
jcotton4214mo ago
you'll have to look at the breaking change notes for all the in-between versions
Mango
MangoOP14mo ago
We would need to review all the breaking changes from after 1.1 all the way to NET 6? That makes sense
afrazier
afrazier14mo ago
Exactly
jcotton42
jcotton4214mo ago
why are you still on 1.1 😆
Mango
MangoOP14mo ago
Business
afrazier
afrazier14mo ago
Or.... YOLO it and see what doesn't work.
Mango
MangoOP14mo ago
That’s what QA is currently doing
afrazier
afrazier14mo ago
They're the ones that will have to deal with it, so... yay for them I guess.
Mango
MangoOP14mo ago
We noticed EF Core has some LINQ translation issues we didn’t have when we were at 1.1
afrazier
afrazier14mo ago
That's... unusual. Oh wait.. no. maybe not.
Mango
MangoOP14mo ago
So they asked me to go through the C# codebase and find any and all “potential” issues.
afrazier
afrazier14mo ago
MS moved a bunch of stuff from client evaluated to server evaluated between .NET Core versions.
jcotton42
jcotton4214mo ago
also you can only client-side eval in the last part of the query (thank god)
afrazier
afrazier14mo ago
Took them a few versions to get back to what EF6 had been doing. 😄
Mango
MangoOP14mo ago
Yeah it couldn’t handle String.Equals(String, StringComparison) in IQueryable<T>.Where()
jcotton42
jcotton4214mo ago
pretty sure that had been client-sided b/c that isn't translatable to SQL EF was silently fucking you over
afrazier
afrazier14mo ago
Yup.
Mango
MangoOP14mo ago
We don’t need ordinal ignore case anyway
afrazier
afrazier14mo ago
EF Core 1.1 said "can't do that in SQL, so I'll just pull everything down to the client and filter it there!"
Mango
MangoOP14mo ago
We just throw ToLower and call it a day
jcotton42
jcotton4214mo ago
(or set the column collation, if you're always doing it that way)
afrazier
afrazier14mo ago
If you're running against SQL Server with default collations, they're case-insensitive anyway.
Mango
MangoOP14mo ago
I believe that is set It depends if it’s set in our migrations properly Which I haven’t seen If not then we could do that as tech debt But if we get to the point where we need to support globalization and how different languages handle lower case vs upper case The collation solution is fine
jcotton42
jcotton4214mo ago
Turkish catlurk
afrazier
afrazier14mo ago
Not if you're using OrdinalIgnoreCase You'd also have to deal with string normalization too. If memory serves
Mango
MangoOP14mo ago
We were, I removed that in favor of e => e.Foo.ToLowe() == string.ToLower() That translates just fine Anyway, thanks for the explanation, that makes more sense. I was like
afrazier
afrazier14mo ago
Yeah, I think it was EF Core 3.1 or EF Core 5 that really changed the rules on how queries were translated to SQL.
Mango
MangoOP14mo ago
I felt like I was going from Senior Developer to Senior Citizen Developer For the better it sounds like?
afrazier
afrazier14mo ago
Overall yeah.
Mango
MangoOP14mo ago
These MFS are filtering, then loading the result set into memory to do ordering/group by etc
Mango
MangoOP14mo ago
How do you remove link previews?
afrazier
afrazier14mo ago
There's an "x" you can hover over on desktop. Not on mobile.
Mango
MangoOP14mo ago
Lame
jcotton42
jcotton4214mo ago
place the url in <>
afrazier
afrazier14mo ago
However, if you post your link between angle brackets <http://path to foo> Then the preview isn't generated. I was just lazy
Accord
Accord14mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server