Skip to content

Adding changes to support use monovsdbg to debug wasm apps.#7220

Open
thaystg wants to merge 37 commits intodotnet:mainfrom
thaystg:dev/thays/support_wasm_monovsdbg
Open

Adding changes to support use monovsdbg to debug wasm apps.#7220
thaystg wants to merge 37 commits intodotnet:mainfrom
thaystg:dev/thays/support_wasm_monovsdbg

Conversation

@thaystg
Copy link
Copy Markdown
Member

@thaystg thaystg commented Jun 10, 2024

Adding changes to support debug wasm apps using monovsdbg.

image

Tested scenarios with the new setting enabled and this PR:

  • With Assets and C# DevKit Not Installed targetting .NET 8 (Blazor Wasm) - DISABLED

  • With Assets and C# DevKit Not Installed targetting .NET 8 (Blazor Server Wasm) - DISABLED

  • With Assets and C# DevKit Not Installed targetting .NET 9 (Blazor Wasm) - ENABLED

  • With Assets and C# DevKit Not Installed targetting .NET 9 (Blazor Server Wasm) - ENABLED

  • With Assets and C# DevKit Installed targetting .NET 8 (Blazor Wasm) - DISABLED

  • With Assets and C# DevKit Installed targetting .NET 8 (Blazor Server Wasm) - DISABLED

  • With Assets and C# DevKit Installed targetting .NET 9 (Blazor Wasm) - ENABLED

  • With Assets and C# DevKit Installed targetting .NET 9 (Blazor Server Wasm) - ENABLED

  • Without Assets and C# DevKit Installed targetting .NET 8 (Blazor Wasm) - DISABLED

  • Without Assets and C# DevKit Installed targetting .NET 8 (Blazor Server Wasm) - DISABLED

  • Without Assets and C# DevKit Installed targetting .NET 9 (Blazor Wasm) - ENABLED

  • Without Assets and C# DevKit Installed targetting .NET 9 (Blazor Server Wasm) - ENABLED

Tested scenarios only updating C# DevKit with the monovsdbg support:

  • Without Assets and C# DevKit Installed with C# extension without this PR targetting .NET 8 (Blazor Wasm) - DISABLED
  • Without Assets and C# DevKit Installed with C# extension without this PR targetting .NET 8 (Blazor Server Wasm) - DISABLED
  • Without Assets and C# DevKit Installed with C# extension without this PR targetting .NET 9 (Blazor Wasm) - DISABLED
  • Without Assets and C# DevKit Installed with C# extension without this PR targetting .NET 9 (Blazor Server Wasm) - DISABLED

Tested scenarios with this PR and C# DevKit without the monovsdbg support:

  • With Assets and C# DevKit Installed targetting .NET 8 (Blazor Wasm) - DISABLED

  • With Assets and C# DevKit Installed targetting .NET 8 (Blazor Server Wasm) - DISABLED

  • With Assets and C# DevKit Installed targetting .NET 9 (Blazor Wasm) - ENABLED

  • With Assets and C# DevKit Installed targetting .NET 9 (Blazor Server Wasm) - ENABLED

  • Without Assets and C# DevKit Installed targetting .NET 8 (Blazor Wasm) - DISABLED

  • Without Assets and C# DevKit Installed targetting .NET 8 (Blazor Server Wasm) - DISABLED

  • Without Assets and C# DevKit Installed targetting .NET 9 (Blazor Wasm) - DISABLED

  • Without Assets and C# DevKit Installed targetting .NET 9 (Blazor Server Wasm) - DISABLED

@thaystg thaystg marked this pull request as ready for review June 22, 2024 00:38
@thaystg thaystg requested review from a team as code owners June 22, 2024 00:38
@thaystg thaystg requested a review from gregg-miskelly June 22, 2024 00:52
@thaystg
Copy link
Copy Markdown
Member Author

thaystg commented Jun 28, 2024

@gregg-miskelly can you please review again?
I think I addressed all your comments.

@thaystg thaystg requested a review from gregg-miskelly July 2, 2024 15:28
@thaystg thaystg marked this pull request as ready for review August 8, 2025 13:27
@thaystg
Copy link
Copy Markdown
Member Author

thaystg commented Aug 8, 2025

Can I get a review again here?

]
},
{
"id": "VSWebAssemblyBridge",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id

Should this be added here so you can use the update dependencies script?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you push this fix? I don't see it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to push, it's there now.

}
});
assetsPath = assetsPath.slice(0, -1);
return [assetsPath, this.executableProjects[0].outputPath];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.executableProjects[0].outputPath

I am not quite following what this is doing -- we are returning the assetsPath of all the web assembly projects, but then the output path of whatever random project happens to be the first executable project in the solution.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The program name is basically not used, is a requirement for concord, but we don't use it for wasm, that is why I'm getting the first one.
The assets path is used to load the metadata, this one is important.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just use a sentinal program name? Ex: "Blazor WASM"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't it's required that the program exists in the disk.

@macel94
Copy link
Copy Markdown

macel94 commented Jan 22, 2026

can we get some news here?
i am one of the 2 that actually use blazor wasm in wsl2 and would like to be able to debug :D

try {
await this.vscodeType.debug.startDebugging(folder, app);
const terminate = this.vscodeType.debug.onDidTerminateDebugSession(async (event) => {
if (process.platform !== 'win32') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (

Do you need a check that the terminating session is the one you are interested in?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done,

}

private static async launchVsWebAssemblyBridge(urlStr: string): Promise<[string, number, number]> {
const dotnetPath = process.platform === 'win32' ? 'dotnet.exe' : 'dotnet';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const dotnetPath = process.platform === 'win32' ? 'dotnet.exe' : 'dotnet';

This will use the version of dotnet which is globally installed. Is that the one you want? Or do you want the version that comes with the C# extension?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed it, now it's using the one that comes with the C# extension.

let proxyICorDebugPort = -1;
let proxyBrowserPort = -1;
let newUri = '';
const spawnedProxy = cp.spawn(dotnetPath, spawnedProxyArgs, cpOptions);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spawnedProxy

Do you need to handle the process exited before it says it is ready?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Copy Markdown
Contributor

@gregg-miskelly gregg-miskelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

@thaystg thaystg requested a review from gregg-miskelly April 6, 2026 20:06
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

Successfully merging this pull request may close these issues.

5 participants