Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add /waitfordebugger argument to MGCB. (#8227)
* Add `/waitfordebugger` argument to MGCB. The call to `System.Diagnostics.Debugger.Launch` is not supported on Unix based platforms. This makes debugging `MGCB.exe` and Content Pipeline extensions difficult. So lets add a new argument which will make `MGCB.exe` wait for a debugger to attach. Also add a extra update to the `launch.json` to demonstrate how to attach the `dotnet` debugger to an existing process. This new system will also work on Windows. To use this in VSCode you can add the following to the `launch.json` ```json { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Attach to Process", "type": "coreclr", "request": "attach", "processId": "${input.processid}", } ], "inputs": [ { "id": "processid", "type": "promptString", "default": "0", "description": "Enter Process Id of process to attach to." } ] } ``` you can then add the following to your `csproj`. ``` <MonoGameMGCBAdditionalArguments>/waitfordebugger</MonoGameMGCBAdditionalArguments> ``` This will cause the `MGCB.exe` to print the ProcessId to the console during the build and wait for the debugger to attach. Once you have the ProcessId you can run the VSCode `Attach to Process` and enter the ProcessId when prompted. The debugger should then attach. If you want to prcess without attaching the debugger just press any key in the console or terminal windows where `MGCB.exe` is running.
- Loading branch information