-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Huge Breaking Issue in Net7 with MemberInfo equality #78218
Comments
And if you do:
this will return false... So memberinfos with different properties are handled as equal |
Maybe a ReflectedType comparison is missing here: https://github.com/dotnet/runtime/blob/main/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimePropertyInfo.cs#L59 |
With Fields it's also an issue. With Methods it works. var i1 = typeof(a).GetProperty("c");
var i2 = typeof(b).GetProperty("c");
Console.WriteLine(i1 == i2);
Console.WriteLine(i1.ReflectedType == i2.ReflectedType);
var i3 = typeof(a).GetMethod("aa");
var i4 = typeof(b).GetMethod("aa");
Console.WriteLine(i3 == i4);
var i5 = typeof(a).GetField("d");
var i6 = typeof(b).GetField("d");
Console.WriteLine(i5 == i6);
Console.WriteLine(i5.ReflectedType == i6.ReflectedType);
Console.ReadLine();
class a
{
public string c { get; set; }
public void aa() { }
public string d;
}
class b : a
{ } |
Could be a huge problem with linq2db and fluent mapping. It depends on the correct behavior. |
And a question, will there be an Hotfix? |
Note that this reproduces only under debugger with hot-reload enabled. You can work around this by disabling hot-reload.
ReflectedType comparison is missing in the Equals method. The CacheEquals method is fine. |
/cc @lambdageek |
I've the issue also in VS when I disable Hotreload |
And also in release Mode. |
It don't appear to happen if you don't start from Visual Studio |
Now I understand why I don't saw this issue in my logfiles. I was looking why our App does not work in Net7 and thought this is the issue. But so it's not. It's only an issue while debugging. Now I need to look what's wrong without debugger... |
really? milestone 8.0.0? |
We always start with current (8.0 here) then backport. |
Tag @ericstj @jeffhandley for porting the fix to 7.0 |
Seems reasonable to backport. Regression from last release in a common scenario with non-trivial workaround. Proceed with fix in main then open the backport pr and add template when ready. |
can you tell me how to disable it when I start the app from within visual studio? |
I just checked - it is not possible to completely disable hot-reload when running under debugger. Parts of it are automatically enabled when debugger is attached. I am sorry that the workaround that I have suggested does not work. |
@jkotas |
Yes, I agree: #78540 |
Description
If you compare 2 Memberinfos in Net7 from a Class and a Base they are equal in 7 but not in Previous Versions.
Cause of this my Database Mapping Framework did not work any more.
see issue: linq2db/linq2db#3823
Reproduction Steps
Try this code in Net6 it returns false, in 7 it returns true
Expected behavior
Code should return false
Actual behavior
returns tre
Regression?
Yes
Known Workarounds
None
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: