#55857·roslyn

VS2019 debugger unable to select correct .NET Core Assembly when debugging with multiple AssemblyLoadContext(s).

Author: vsfeedbackCreated Aug 24, 2021Updated Sep 16, 2026
LabelsBugInteractive-DebuggingArea-External
_This issue has been moved from [a ticket on Developer Community](https://developercommunity2.visualstudio.com/t/VS2019-debugger-unable-to-select-correct/864954)._ --- # Note This bug *completely breaks* the expression evaluator, making you unable to use the watch list, view autos/locals and query anything in general etc. I documented it on [Github](https://github.com/Sewer56/VisualStudioNetCoreALCDebuggerBug). (Copy of Readme available below) The repository contains a complete minimal reproduction for the issue and steps to reproduce. I wouldn't consider it major yet; however as AssemblyLoadContext(s) got properly documented recently and developers are encouraged to switch to .NET Core, it is inevitable that many users working with plugin systems will inevitably run into this issue. For the sake of duplicate issues from developers migrating to CoreCLR in the future, I'd consider it something better fixing sooner than later. # Visual Studio Debugger Bug This repository hosts a simple reproduction for a specific bug I found while working on [Reloaded-II](https://github.com/Reloaded-Project/Reloaded-II) Mod Loader. The bug consists of AssemblyLoadContext(s) and Visual Studio debugger's inability of picking the correct module for the current ALC while debugging. ### The Bug: Summarized 1. Create an AssemblyLoadContext. In the ALC, load an outdated version of a library. 2. Create a second AssemblyLoadContext. In the second ALC, somewhere in code, return a value from an API not available in the outdated version loaded by the other ALC. 3. Place a breakpoint after that API access, inspect the value. **Expected Result:** Returned value can be viewed as normal. **Actual Result:** Name | Value ------------------ | ------------------------------------------------------------ integerAsReference | error CS7069: Reference to type 'RefPointer<>' claims it is defined in 'Reloaded.Memory', but it could not be found | | Works with any external library. The expression evaluator is *completely broken*, you cannot query or modify any variable anywhere. Watch list does not work, autos and locals are empty, etc. --- ### Original Comments #### Feedback Bot on 12/22/2019, 06:45 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

#### Feedback Bot on 12/23/2019, 10:28 AM:

This issue is currently being investigated. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.

#### Feedback Bot on 3/31/2020, 05:21 PM:

Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2019#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.

#### Feedback Bot on 4/23/2020, 09:24 PM: I have detected that for the last 35 days, this issue didn't have much product team activity and a very small amount of new votes or comments. Based on this, its severity, and affected area, it’s my experience that this issue is very unlikely to be fixed. --- ### Original Solutions (no solutions)