Skip to content
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

issue with attached debugging of a C# dll from F# polyglot #3605

Open
2 tasks done
novitk opened this issue Jul 21, 2024 · 5 comments
Open
2 tasks done

issue with attached debugging of a C# dll from F# polyglot #3605

novitk opened this issue Jul 21, 2024 · 5 comments

Comments

@novitk
Copy link

novitk commented Jul 21, 2024

When attaching debugger to F# interactive session from polyglot specifically, hitting breakpoints results in "The application is in break mode" window, instead of hitting breakpoint normally. Note that the same works fine if using C# polyglot cells or console based fsi.
If you disable "Just my code" in VStudio options than you can see some exceptions are getting hit inside Microsoft.DotNet.Interactive. I'm not sure how relevant this is.
Thx, KN

Version: 1.0.522904+cdfa48b2ea1a27dfe0f545c42a34fd3ec7119074
Library version: 1.0.0-beta.24229.4+cdfa48b2ea1a27dfe0f545c42a34fd3ec7119074
Build date: 2024-06-29T19:03:08.5793733Z

  • OS
    • Windows 10
  • Frontend
    • Visual Studio Code

Screenshots

all attached in zip please see png
issue.zip

@novitk novitk changed the title issue with debugging an attached C# dll from F# interactive issue with debugging an attached C# dll from F# polyglot Jul 21, 2024
@novitk novitk changed the title issue with debugging an attached C# dll from F# polyglot issue with attached debugging of a C# dll from F# polyglot Jul 21, 2024
@jonsequitur
Copy link
Contributor

It's surprising that this would behave differently. Both of these kernels run in the same process. It seems like there might be some difference in the way that the two different kernels load referenced assemblies and that could affect the debugger.

FWIW, the way that I typically attach a debugger in Polyglot Notebooks is like this, which saves you having to write out the PID and attach manually:

System.Diagnostics.Debugger.Launch();

@jonsequitur
Copy link
Contributor

@KevinRansom Any ideas here?

@KevinRansom
Copy link
Member

I expect it is because we don't generate symbols. We can see what we can do to improve it. It would be fair to say that even under fsi the debugging experience isn't great.

@novitk
Copy link
Author

novitk commented Aug 7, 2024

Non-intuitive to me why not having symbols (I assume for F#) would impact C# debugging.
One other thing I noticed that is probably not relevant but just in case... The AssemblyLoadContext usage in Interactive is quite diff between the two languages: F# is using a Default singleton, while C# creates a specialized one for every "#r".

@jonsequitur
Copy link
Contributor

#r nuget is directly supported by F# Interactive but not by C# Script. For this reason, the implementation for C# is in this codebase, while the F# implementation is not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants