C
C#9mo ago
Mango

❔ NET 6 breaking changes

Breaking changes in .NET 6
Navigate to the breaking changes in .NET 6.
56 Replies
Mango
Mango9mo 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
jcotton429mo 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
Mango9mo 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
jcotton429mo 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
Mango9mo 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
jcotton429mo ago
I simply wouldn't worry about the binary compatibility thing unless you fall into the situation I just described
Mango
Mango9mo ago
What about compiles? Compiled
jcotton42
jcotton429mo ago
you mean source compatible?
Mango
Mango9mo ago
Yeah that one
afrazier
afrazier9mo ago
Then you care about source compatibility.
jcotton42
jcotton429mo ago
then code compiled under .net 6 will have different behavior unless you take the workaround steps outlined (if available)
Mango
Mango9mo ago
Also, these changes are only comparing NET 6 to the previous (major?) release? Like NET 5 to NET 6?
jcotton42
jcotton429mo ago
yes
afrazier
afrazier9mo ago
Correct
Mango
Mango9mo ago
So if we migrated from say NET Core 1.1 to NET6
afrazier
afrazier9mo ago
You'd have a lot of release notes to wade through.
jcotton42
jcotton429mo ago
you'll have to look at the breaking change notes for all the in-between versions
Mango
Mango9mo ago
We would need to review all the breaking changes from after 1.1 all the way to NET 6? That makes sense
afrazier
afrazier9mo ago
Exactly
jcotton42
jcotton429mo ago
why are you still on 1.1 😆
Mango
Mango9mo ago
Business
afrazier
afrazier9mo ago
Or.... YOLO it and see what doesn't work.
Mango
Mango9mo ago
That’s what QA is currently doing
afrazier
afrazier9mo ago
They're the ones that will have to deal with it, so... yay for them I guess.
Mango
Mango9mo ago
We noticed EF Core has some LINQ translation issues we didn’t have when we were at 1.1
afrazier
afrazier9mo ago
That's... unusual. Oh wait.. no. maybe not.
Mango
Mango9mo ago
So they asked me to go through the C# codebase and find any and all “potential” issues.
afrazier
afrazier9mo ago
MS moved a bunch of stuff from client evaluated to server evaluated between .NET Core versions.
jcotton42
jcotton429mo ago
also you can only client-side eval in the last part of the query (thank god)
afrazier
afrazier9mo ago
Took them a few versions to get back to what EF6 had been doing. 😄
Mango
Mango9mo ago
Yeah it couldn’t handle String.Equals(String, StringComparison) in IQueryable<T>.Where()
jcotton42
jcotton429mo ago
pretty sure that had been client-sided b/c that isn't translatable to SQL EF was silently fucking you over
afrazier
afrazier9mo ago
Yup.
Mango
Mango9mo ago
We don’t need ordinal ignore case anyway
afrazier
afrazier9mo 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
Mango9mo ago
We just throw ToLower and call it a day
jcotton42
jcotton429mo ago
(or set the column collation, if you're always doing it that way)
afrazier
afrazier9mo ago
If you're running against SQL Server with default collations, they're case-insensitive anyway.
Mango
Mango9mo 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
jcotton429mo ago
Turkish catlurk
afrazier
afrazier9mo ago
Not if you're using OrdinalIgnoreCase You'd also have to deal with string normalization too. If memory serves
Mango
Mango9mo 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
afrazier9mo 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
Mango9mo ago
I felt like I was going from Senior Developer to Senior Citizen Developer For the better it sounds like?
afrazier
afrazier9mo ago
Overall yeah.
Mango
Mango9mo ago
These MFS are filtering, then loading the result set into memory to do ordering/group by etc
Mango
Mango9mo ago
How do you remove link previews?
afrazier
afrazier9mo ago
There's an "x" you can hover over on desktop. Not on mobile.
Mango
Mango9mo ago
Lame
jcotton42
jcotton429mo ago
place the url in <>
afrazier
afrazier9mo 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
Accord9mo 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.