-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[debugger] CORDBG_E_MISSING_METADATA error when inspecting EF Core classes in .Net 6 #68929
Comments
Tagging subscribers to this area: @tommcdon Issue DetailsGood afternoon dotnet runtime team! DescriptionI am currently looking into a debugger error in our application when trying to inspect EF Core entities in Visual Studio and Rider. I was able to find the error code CORDBG_E_MISSING_METADATA in this repository, as well as this comment which seems to indicate something has gone wrong when fetching the metadata when debugging the EF class. I suspect it is a configuration issue with our project as when creating a new .Net 6 solution the issue does not happen, but I am not sure where to look for fixing it. This has only become an issue after updating our project from .Net 5 to .Net 6. Please let me know if you have any insights into this error code and if there is any configuration I should validate is correct. Here are some screen shots of the debugging window within Rider Reproduction:
Environment details:
Project details I think might be relevant from the
|
Author: | jamesonweber |
---|---|
Assignees: | - |
Labels: |
|
Milestone: | - |
Hello @jamesonweber! The CORDBG_E_MISSING_METADATA error can occur if we fail to extract the metadata for the module loaded into the debugger.
Would it be possible to reduce the repro down to a small test case that can shared a ZIP file? Also it might be useful to share a dump of the target process at the point of failure. I believe either a dump collected with Visual Studio or with task manager should be able to work in that scenario. |
@tommcdon thank you for the very quick response! I have opened a new issue with the dump file here: https://developercommunity.visualstudio.com/t/debugger-CORDBG_E_MISSING_METADATA-err/10035184?space=61&entry=problem In it I noted that reducing our solution to a slimmed down version will require quite a bit of effort. Please let me know if it is needed with the dump file. If it is, I can discuss doing that with our team further, but we are hoping the dump file will be sufficient. I would like to add that it looks like the debugger in visual studio is producing a different exception than rider that was not noticed in the original investigation (we just noticed the exception originally and not the type, sorry about that!). This is the stack trace when inspecting a variable from the debugger in visual studio:
|
@jamesonweber based on your description, I strongly believe that the PR I just opened (#72315) will fix your issue. Would you be able to try your repro with a private runtime to confirm? I can give you instructions on how. |
This issue has been marked |
@davmason That is great news! Sorry for the late reply, it's been a busy week. Yup, I can try our project with the private runtime, but some instructions for how would be greatly appreciated. |
@jamesonweber how to patch depends on how exactly you deploy your app and what runtime you can target. The actual patch is copying some files, but depending on how you publish and run you application it might vary a bit. Are you able to retarget your app to the latest 7.0 preview? If so that makes it easier - I have private builds for Windows x86 and x64 here: https://github.com/davmason/runtime/releases/tag/7.0.0-rc1-debugger-metadata-fix. If you have to stay on 6 then I would have to make a special version of 6 with the fix. To apply those, you would download the appropriate architecture and paste it over the existing binaries (be sure to make a backup of anything if you want to revert later). Assuming you are doing a framework dependent publish
You have to be administrator to copy and all dotnet processes using that runtime need to be stopped. If you are publishing self contained then you would need to copy the contents of the appropriate architecture to your deployment folder, but otherwise it should be the same. |
This issue has been marked |
This issue has been automatically marked |
I apologize in the delay testing this; it has been a very busy couple of weeks. I will look into testing the patch this week or next. |
@davmason I was able to sneak some testing time in today, and the results are that the patch appears to resolved the issue! 🎉 Everything is evaluating as expected in the debugger now. Thank you so much @davmason and @tommcdon for all the help on this, we really appreciate it. We can close this issue now from our perspective. I'll let you do that in case there are any loose ends you need to tie up. |
Thanks for verifying, closing this issue |
As this appears to be fairly straightforward change, is there any chance of getting this into a future .NET6 release, given that is the LTS version? |
I will create a PR and send it for .NET 6 consideration |
Good afternoon dotnet runtime team!
Description
I am currently looking into a debugger error in our application when trying to inspect EF Core entities in Visual Studio and Rider. I was able to find the error code CORDBG_E_MISSING_METADATA in this repository, as well as this comment which seems to indicate something has gone wrong when fetching the metadata when debugging the EF class. I suspect it is a configuration issue with our project as when creating a new .Net 6 solution the issue does not happen, but I am not sure where to look for fixing it. This has only become an issue after updating our project from .Net 5 to .Net 6.
Please let me know if you have any insights into this error code and if there is any configuration I should validate is correct.
Here are some screen shots of the debugging window within Rider
Reproduction:
dotnet run
Attach Debugger to Process
Failed to get base type: The operation failed because the debugger could not get the metadata.
Environment details:
Project details I think might be relevant from the
csproj
file:<Project Sdk="Microsoft.NET.Sdk.Web">
)<TargetFramework>net6.0</TargetFramework>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.4">
Thank you in advance if any help / advice on the above error code!
The text was updated successfully, but these errors were encountered: