question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to debug code loaded in more than one ALC

See original GitHub issue

Consider this setup:

  • Library1
  • Plugin1 (depend on Library1, via project reference)
  • Plugin2 (depend on Library1, via project reference)
  • Host (console app)

Host is using PluginLoader.CreateFromAssemblyFile(pluginPath) to load both plugin assemblies, and calls a “startup” method in them. Plugins call a common method in Library1.

No shared types and no custom options in use.

If I debug the host, I can step Host -> Plugin -> Library1 when the first plugin is loaded. But when the second one is, I can not step into method of Library1. Also, I see a message (in Debug Output) that Library1 from path of Plugin can’t load. (Using VS Code to debug, but tested VS 17 too). That part is also confusing, since why shouldn’t it load in the second ALC?

Let me know if you want me to craft a repro.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
natemcmastercommented, Nov 27, 2018

Thanks for sharing. I’m going to close this in favor of https://github.com/dotnet/coreclr/issues/20607

1reaction
natemcmastercommented, Nov 26, 2018

This seems like a bug in .NET Core itself and the way AssemblyLoadContext works. This library doesn’t do anything special with symbols, or do anything to prevent symbols from loading. If there is something this library needs to do to help IDE’s find symbols, I’m happy to add that, but I don’t know what that would be.

I would recommend opening a bug on github.com/dotnet/core to see if the coreclr team can help with this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Multiple project visual studio solution won't debug one ...
The dlls have not been loaded to the process which you are trying to debug, under project properties check if optimize code is...
Read more >
How to use and debug assembly unloadability in .NET
Threads running code from an assembly loaded into the collectible AssemblyLoadContext . Instances of custom, non-collectible AssemblyLoadContext ...
Read more >
CCS: How can I debug multiple launchpads simultaneously ...
I'm trying to debug a mesh radio project which involves multiple launchpads all running exactly the same code with CCS, but it won't...
Read more >
Why can't the breakpoint be "hit" when debugging an ...
If no breakpoints are hit it's possible an exception is occurring in the constructor and the tool never runs. Check by showing all...
Read more >
TS Server fatal error: Debug Failure. False expression ...
False expression: getScriptInfo Verbose Debug Information: scriptInfo for a file 'e:/code/pingtaiqianyi/alc-subapp-purchasemanage/src/__VLS_types.ts' Path: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found