DotTrace - Attach to running process

Hi,

 

i'm trying to find out which methods were called most and how long they took so I thought DotTrace could help me out there!

However, I'm having troubles starting the dot trace application for an already running .NET Core application. I don't know what to choose, however when I select the *.exe of my program, then it does not attach but it starts it. That's not what I want because I use a custom profile and other configuration to start my application. 

 

Is it possible to attach to .NET Core process or exe?

 

0
5 comments
Hello, 

You can attach to the Running Process using:
0

I tried Rider Integration but it says

Could not attach to the process 10940. Der Wert liegt außerhalb des erwarteten Bereichs. The error code is E_INVALIDARG, orCOR_E_ARGUMENT, orWIN32_ERROR_INVALID_PARAMETER, or0x80070057

If I try the standalone variant and choose my exe, a dialog opens where I need to choose a new configuration. I choose the .exe because it seems like Rider does not open a new dotnet instance to run the application? At least the listed dotnet.exe does not point to the bin/debug folder. However, this configuration starts the .exe.. To be sure that the .exe is started by Rider, I stopped debugging and the .exe is gone from the list.

-------------------------------------------------------------------------------

I tried "Profile running process" and it seems to be able to profile a running .exe.

 

I'm not certain that the times are correct, are they? I used StopWatch to measure a methods running time and it says 45 seconds for example. The timeline profile analyzis however says that the time spent in the method is 268ms. How does this come? I want to tackle performance and want to find out where to start.

0

Hello,

Could you describe your scenario with “attach” in more detail? Please describe your steps with screenshots or record a screencast with all actions if it’s possible.
Also, could you please send us some examples that show the time differences? Maybe you’ve set some kind of filters in the Timeline Viewer, e.g. “Running Thread State”. Please attach a screenshot with this difference and provide Timeline snapshot if it’s possible.
You can upload large files to our ftp: https://uploads.jetbrains.com/

0

Hi Valentina,

 

sure. Instead of using "Run -> Attach to process.." I rather use "Run -> Profile running process.." because this does not start the specified application but really attaches to it. I added a video showing my actions. Maybe I'm doing it the wrong way but the measurement is extremely different from the C# Stopwatch class. 

The screencast Id is: 2021_12_07_WHqtBSGCfq8XPqn5

 

0

Hello,

Could you please send us this snapshot if it possible?
Or could you do these steps with screenshots or record a screencast with all actions if it’s possible again?

  • Select your async method in Hotspots
  • Select “Merge Method Occurrences” in context menu
  • Show us the results in Hotspots and CallTree

You also can upload large files to our ftp: https://uploads.jetbrains.com/

0

Please sign in to leave a comment.