You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error System.MissingMethodException thrown when trying to see the query plan of an IQueryable variable #28
Hello,
I was trying to use the extension with VS 2022, latest version 17.9.1, but I got this error:
Cannot evaluate expression since the function evaluation requires all threads to run.
Then I checked the logs in the Output window and found this:
System.MissingMethodException thrown when loading the VisualizerAssemblyLoadContext. Message: Cannot dynamically create an instance of type 'Microsoft.VisualStudio.NetCoreAssemblyResolution.VisualizerAssemblyLoadContext'. Reason: No parameterless constructor defined.
My IQueryable variable is something not too fancy, I'm working in a private code base so I can't post the actual tables, but it resembles something like this:
It looks like an internal VS issue because I don't instantiate VisualizerAssemblyLoadContext anywhere in my code. When I search for VisualizerAssemblyLoadContext on GitHub the only result is this issue. I suggest you report the issue and link to this issue in case they want to reach out to me.
Hi @Giorgi I have tested with a different project, a simpler one, and with the VS Enterprise edition I also have installed, and it worked this time. This is how it looks like:
No problem sharing this query, it's from a side project not in actual and real development 😄
After testing it in the Enterprise edition, I opened the same solution in the VS Pro edition, and it worked this time as well.
So, this could be related to either the VS edition I was using EFCore.Visualizer with (maybe I have to use it in both editions so the extension gets "activated" in both), or related to the source code, but I highly doubt it could be related to the code.
All these projects are .NET 8 based, using EF Core 8 and SQL Server, with the latest updates. The only difference is the type of project. The one from the original issue was a console app, whereas the one I tested with the Enterprise edition is an MVC web app.
I'll test with other projects (work and side projects) to check if EFCore.Visualizer works correctly.
@Giorgi as a conclusion for this issue, I think the visualizer sometimes works and sometimes doesn't depending on the dependencies and complexities the projects might have.
For example, when testing with simpler web and console projects, the visualizer works as expected. However, in more complex ones, with dependencies on Azure, Redis, and third-party libraries and other services, those bother the debugger somehow and prevent the visualizer from working.
I think we can close this issue as not reproducible or not fixed, it is hard to reproduce. If I notice a different behavior in the future, I would add a new comment here.
After a long investigation by @jmoralesv, it turned out that the "Cannot evaluate expression since the function evaluation requires all threads to run." error was caused by Application Insights. It profiles database queries and is probably trying to send the data on a background thread causing the above error.
Thank you again Jorge for spending so much time to find the root cause.
Activity
Giorgi commentedon Feb 27, 2024
It looks like an internal VS issue because I don't instantiate
VisualizerAssemblyLoadContextanywhere in my code. When I search forVisualizerAssemblyLoadContexton GitHub the only result is this issue. I suggest you report the issue and link to this issue in case they want to reach out to me.jmoralesv commentedon Feb 29, 2024
Hi @Giorgi I have tested with a different project, a simpler one, and with the VS Enterprise edition I also have installed, and it worked this time. This is how it looks like:
No problem sharing this query, it's from a side project not in actual and real development 😄
After testing it in the Enterprise edition, I opened the same solution in the VS Pro edition, and it worked this time as well.
So, this could be related to either the VS edition I was using EFCore.Visualizer with (maybe I have to use it in both editions so the extension gets "activated" in both), or related to the source code, but I highly doubt it could be related to the code.
All these projects are .NET 8 based, using EF Core 8 and SQL Server, with the latest updates. The only difference is the type of project. The one from the original issue was a console app, whereas the one I tested with the Enterprise edition is an MVC web app.
I'll test with other projects (work and side projects) to check if EFCore.Visualizer works correctly.
jmoralesv commentedon Mar 9, 2024
@Giorgi as a conclusion for this issue, I think the visualizer sometimes works and sometimes doesn't depending on the dependencies and complexities the projects might have.
For example, when testing with simpler web and console projects, the visualizer works as expected. However, in more complex ones, with dependencies on Azure, Redis, and third-party libraries and other services, those bother the debugger somehow and prevent the visualizer from working.
The only constant thing is the System.MissingMethodException error which always appears in the Debug output window. I have just reported that error to the Developer Community site, as that is the only constant error appearing during my tests: https://developercommunity.visualstudio.com/t/SystemMissingMethodException-thrown-whe/10612094
I think we can close this issue as not reproducible or not fixed, it is hard to reproduce. If I notice a different behavior in the future, I would add a new comment here.
Giorgi commentedon Mar 25, 2024
After a long investigation by @jmoralesv, it turned out that the "Cannot evaluate expression since the function evaluation requires all threads to run." error was caused by Application Insights. It profiles database queries and is probably trying to send the data on a background thread causing the above error.
Thank you again Jorge for spending so much time to find the root cause.
jmoralesv commentedon Mar 25, 2024
@Giorgi thanks to you for your help!