Trottero / dotnet-watch-attach

Dotnet watch attach vscode plugin
7 stars 7 forks source link

Mac support #5

Closed Trottero closed 2 years ago

Trottero commented 2 years ago

Sorry - it's taken so long to get back to you. I should point out, I'm on a Mac so we are not using .exe programs. The program EPBC.PSAS.dll is running after launching dotnetwatchattach. I have verified this by starting dotnetwatchattach with program commented out, which gives the error. "Cannot find a program to debug". However, with program not commented out and dotnetwatchattach running, my breakpoints become unbound.

Originally posted by @dfdumaresq in https://github.com/Trottero/dotnet-watch-attach/issues/4#issuecomment-1171515302

Trottero commented 2 years ago

The plugin is untested on Mac, as I do not own one myself. If I have the time I could attempt to find a service which could provide me with a VM.

dotnetwatchattach uses some OS specific commands to get the current list of running programs, there should be a linux ready implementation, but it is also untested. It does a quick check before attaching to said program in order to check if it is actually running.

It might be worth trying to set program to EPBC.PSAS.dll, as a similar structure was used for projects<.NET 5.0. This plugin passes the program parameter directly to dotnet CLR debugger, so the value has to be name of process.

loganbenjamin commented 2 years ago

I've created a pull request for mac support #8

Works on my M1 Mac running standard .Net 6.0 apps

Trottero commented 2 years ago

@loganbenjamin Great, thank you! Could you post the exact output of the command that you added? Ideally while a dotnet program is running using dotnet watch - Really happy to see you created a PR though!

loganbenjamin commented 2 years ago

No worries, this is a great extension you've made!

In the below screenshot I ran ps -aco command before and after I started dotnet watch.

You can see there is 3 new dotnet commands and one Hello.World (the name of my app).

image

Trottero commented 2 years ago

Looks good to me - On more thing though, would you mind checking if it works with project names longer than 16 characters? Was having some issues with the linux version as the ps command would only show the first couple of characters.

loganbenjamin commented 2 years ago

Yes, it works with a project I have that has 24 characters

Trottero commented 2 years ago

The update is currently rolling out, thank you for your contribution :)

🎉