Skip to content

How to debug mapperly in Visual Studio 2022? #50

Closed Answered by latonz
ycherkes asked this question in Q&A
Discussion options

You must be logged in to vote

Note the compilation and therefore the execution of the source generator happens in a different process, before the command line application runs.

Mapperly uses a compile constant DEBUG_SOURCE_GENERATOR to determine whether to attach a debugger. If it is set, it tries to attach a debugger (it uses Debugger.Launch() on windows, on macos it tries to launch jetbrains rider) and waits for the connection of the debugger (up to 30seconds). If the automatic debugger attachment fails (eg. if rider can't be found on macos, you use linux, ...) you can use these 30 seconds to attach your debugger manually (for vs 2022 see attach to running processes). You can use the DefineConstants dontet build or …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ycherkes
Comment options

Answer selected by ycherkes
Comment options

You must be logged in to vote
1 reply
@latonz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants