So I just found a Google "easter egg" you REALLY don't want to find...
-
I'm not a C# dev but the commit for that code[^] appears to imply that the switch
"Microsoft.EntityFrameworkCore.Issue23659"
can be used to avoid that code path. I'm heading out the door, be back in a few hours.Already fixed it. Used the same C# property for two separate navigational properties. Which "sort of" works, apparently :~ The exception really doesn't make sense though, as do the symptoms X|
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
This "fixer upper" appears not to be part of the "public API" for EF. My first impression is to comment it out. Sounds like someone's (GitHub) "Hail Mary" for a situation that may not even exist. Like "garbage collecting" when it isn't necessary, effective or understood.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
The code only uses "official" code. No "someone's quick 'n' dirty fix from the internet" code. Fixed it though, apparently I was using a single property for two separate navigation properties, which sort of works :~ Weird behavior and weird error though X|
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
Nope. Apparently I was using a single property for two separate navigation properties, which "sort of" works :~ Weird behavior and weird error though X|
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
My someone else's code that I'm currenctly working on breaks with a NullReferenceException, except... The exception seems to have to do with lazy loading in entity framework. When I set a breakpoint and inspect some variables quickly enough they're null. After that the code stopped executing a few seconds and everything runs fine. When I don't set a breakpoint it breaks because some variable is null. When the code breaks and I inspect every variable in the block, nothing is null. Weird issue, I've never seen it before. So naturally, I google for "nullreferenceexception "FixupSkipNavigations"" (FixupSkipNavigations is where the exception occurs and I have little else to go by). Well, Google it for yourself... No results :(( I get a yeti who's ice fishing and catches a boot, an empty can, a can of sardines or a fish when you click it. THIS IS NOT HELPING X|
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
Look for WeakReference in the code. There's also Lazy but I doubt that's causing it because it's thread safe, at least if you set it up to be - it's worth looking for those too. though. Another thing to look for is harder to search for, but the lazy init pattern used in older code. You'll find it hidden behind property accessors usually. Replace it.
To err is human. Fortune favors the monsters.
-
My someone else's code that I'm currenctly working on breaks with a NullReferenceException, except... The exception seems to have to do with lazy loading in entity framework. When I set a breakpoint and inspect some variables quickly enough they're null. After that the code stopped executing a few seconds and everything runs fine. When I don't set a breakpoint it breaks because some variable is null. When the code breaks and I inspect every variable in the block, nothing is null. Weird issue, I've never seen it before. So naturally, I google for "nullreferenceexception "FixupSkipNavigations"" (FixupSkipNavigations is where the exception occurs and I have little else to go by). Well, Google it for yourself... No results :(( I get a yeti who's ice fishing and catches a boot, an empty can, a can of sardines or a fish when you click it. THIS IS NOT HELPING X|
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
Look for WeakReference in the code. There's also Lazy but I doubt that's causing it because it's thread safe, at least if you set it up to be - it's worth looking for those too. though. Another thing to look for is harder to search for, but the lazy init pattern used in older code. You'll find it hidden behind property accessors usually. Replace it.
To err is human. Fortune favors the monsters.
It was none of that. The code doesn't use WeakReference (nor does any code I've ever seen). I used the same C# property for two separate navigational properties in EF. Which "sort of" works, apparently. The exception really doesn't make sense though, as do the symptoms X|
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
I did see this before. I even had the case where the debug build would work and the release build did not, for what I can only guess would be a similar reason. Don't remember how I solved it though.
V.
I used the same C# property for two separate navigational properties, which "sort of" works, apparently. The exception doesn't make sense though, so it seems to be quite a specific error.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
I used the same C# property for two separate navigational properties, which "sort of" works, apparently. The exception doesn't make sense though, so it seems to be quite a specific error.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
What do you mean "sort of works" ?
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
-
My someone else's code that I'm currenctly working on breaks with a NullReferenceException, except... The exception seems to have to do with lazy loading in entity framework. When I set a breakpoint and inspect some variables quickly enough they're null. After that the code stopped executing a few seconds and everything runs fine. When I don't set a breakpoint it breaks because some variable is null. When the code breaks and I inspect every variable in the block, nothing is null. Weird issue, I've never seen it before. So naturally, I google for "nullreferenceexception "FixupSkipNavigations"" (FixupSkipNavigations is where the exception occurs and I have little else to go by). Well, Google it for yourself... No results :(( I get a yeti who's ice fishing and catches a boot, an empty can, a can of sardines or a fish when you click it. THIS IS NOT HELPING X|
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
Sander Rossel wrote:
Well, Google it for yourself... No results :((
Not true. With "verbatim" search on, there is one result... ... this thread! :laugh:
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Sander Rossel wrote:
Well, Google it for yourself... No results :((
Not true. With "verbatim" search on, there is one result... ... this thread! :laugh:
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Wow, that's indexed rather quickly :omg: :laugh:
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
What do you mean "sort of works" ?
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
It works when I first look at it using the debugger. It sometimes works for the first one or two results, but eventually breaks on the third or fourth. So it sort of works, sometimes. The error isn't consistent.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
Sander Rossel wrote:
Well, Google it for yourself... No results :((
Not true. With "verbatim" search on, there is one result... ... this thread! :laugh:
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Sander Rossel wrote:
Well, Google it for yourself... No results :((
Not true. With "verbatim" search on, there is one result... ... this thread! :laugh:
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Richard Deeming wrote:
Sander Rossel wrote:Well, Google it for yourself... No results :(( Not true. With "verbatim" search on, there is one result... ... this thread! :laugh:
but that has a date of 2 JuneJuly 2011 Other search engines are available: Bing has four matches Editted: Fixed date
-
It was none of that. The code doesn't use WeakReference (nor does any code I've ever seen). I used the same C# property for two separate navigational properties in EF. Which "sort of" works, apparently. The exception really doesn't make sense though, as do the symptoms X|
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
Sander Rossel wrote:
I used the same C# property for two separate navigational properties in EF. Which "sort of" works, apparently. The exception really doesn't make sense though, as do the symptoms X|
Sounds like someone is using
ReferenceEquals
instead of an actual value comparison.Software Zen:
delete this;
-
Sander Rossel wrote:
I used the same C# property for two separate navigational properties in EF. Which "sort of" works, apparently. The exception really doesn't make sense though, as do the symptoms X|
Sounds like someone is using
ReferenceEquals
instead of an actual value comparison.Software Zen:
delete this;
Nah, I don't think I've ever seen ReferenceEquals in C# code, because why would you ever want to know that? The problem was more like:
someEntity.HasMany(x => x.FirstList).WithMany(x => x.OtherList).UsingEntity<...>(...)
someEntity.HasMany(x => x.SecondList).WithMany(x => x.OtherList).UsingEntity<...>(...)Changing that second line fixed the issue.
someEntity.HasMany(x => x.SecondList).WithMany(x => x.SecondOtherList).UsingEntity<...>(...)
Not an obvious error, compiles fine and everything.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
Nah, I don't think I've ever seen ReferenceEquals in C# code, because why would you ever want to know that? The problem was more like:
someEntity.HasMany(x => x.FirstList).WithMany(x => x.OtherList).UsingEntity<...>(...)
someEntity.HasMany(x => x.SecondList).WithMany(x => x.OtherList).UsingEntity<...>(...)Changing that second line fixed the issue.
someEntity.HasMany(x => x.SecondList).WithMany(x => x.SecondOtherList).UsingEntity<...>(...)
Not an obvious error, compiles fine and everything.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
Sander Rossel wrote:
I don't think I've ever seen
ReferenceEquals
in C# code, because why would you ever want to know that?I've used it a few times, mostly in collections and n-way tree structures to identify specific instances.
Software Zen:
delete this;
-
My someone else's code that I'm currenctly working on breaks with a NullReferenceException, except... The exception seems to have to do with lazy loading in entity framework. When I set a breakpoint and inspect some variables quickly enough they're null. After that the code stopped executing a few seconds and everything runs fine. When I don't set a breakpoint it breaks because some variable is null. When the code breaks and I inspect every variable in the block, nothing is null. Weird issue, I've never seen it before. So naturally, I google for "nullreferenceexception "FixupSkipNavigations"" (FixupSkipNavigations is where the exception occurs and I have little else to go by). Well, Google it for yourself... No results :(( I get a yeti who's ice fishing and catches a boot, an empty can, a can of sardines or a fish when you click it. THIS IS NOT HELPING X|
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
My granddaughter (1 year old) got a hold of my laptop and "typed" some gibberish which happened to be on a new Chrome tab and she got the Yeti. Cute when you aren't trying to find something for work.
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.