Closed MikaelElkiaer closed 2 years ago
Hello, MikaelElkiaer!
I'm afraid, currently there is no way to pass any arguments to dotnet run command. You can start your application as usual and then attach the netcoredbg to it.
UPD: You should start netcoredbg from your app's working directory in order it can find .pdb file and then issue a command
ncdb> attach <pid>
Ok, was hoping to avoid this since I cannot find a way to wait for the debugger without adding some statement to my code.
@MikaelElkiaer we'll add this feature, but now you can write simple shell script which run your application, search pid of applications using ps
and next attach NCDB. Its very fast and you'll lose only few milliseconds after start.
If you need some initial setup for debugger you can write such commands to text file and pass to debugger:
netcoredbg --attach <pid> --command=<command_file>
@MikaelElkiaer we'll add this feature, but now you can write simple shell script which run your application, search pid of applications using
ps
and next attach NCDB. Its very fast and you'll lose only few milliseconds after start. If you need some initial setup for debugger you can write such commands to text file and pass to debugger:netcoredbg --attach <pid> --command=<command_file>
Thank you, sounds good with both future prospects and current method.
@MikaelElkiaer, you can now set dotnet run parameters in 2 ways:
@o-lek Awesome, thanks! When will it be released?
@MikaelElkiaer, It's already there. You can try it right now.
It seems to be working, awesome, thanks.
Just to sate my massive confusion? So this was possible all along? I mean, I don't see any relevant updates, anywhere...
So this was possible all along? I mean, I don't see any relevant updates, anywhere...
Seems like that. Fortunately, it was implemented by our colleague who has left our team some time ago. My mistake is that I didn't know about it, I'm very sorry. So, when I started "implementation" a day ago, the only thing I had to do is to check that it works right.
The
dotnet run
command has a parameter--launch-profile
which can be set, referring to a profile defined inProperties/launchSettings.json
. Can I somehow set this parameter when starting a program with netcoredbg?