Sündmused
17. märts, 21 - 21. märts, 10
Liituge sarjaga, et luua muude arendajate ja ekspertidega skaleeritavad tehisintellektilahendused, mis põhinevad reaalajas kasutusjuhtumitel.
Registreeruge koheSeda brauserit enam ei toetata.
Uusimate funktsioonide, turbevärskenduste ja tehnilise toe kasutamiseks võtke kasutusele Microsoft Edge.
This article applies to: ✔️ dotnet-stack
version 5.0.221401 and later versions
There are two ways to download and install dotnet-stack
:
dotnet global tool:
To install the latest release version of the dotnet-stack
NuGet package, use the dotnet tool install command:
dotnet tool install --global dotnet-stack
Direct download:
Download the tool executable that matches your platform:
dotnet-stack [-h, --help] [--version] <command>
The dotnet-stack
tool:
EventPipe
tracing provided by the .NET Core runtime.-h|--help
Shows command-line help.
--version
Displays the version of the dotnet-stack utility.
Command | Description |
---|---|
dotnet-stack report | Prints the stack trace for each thread in the target process. |
dotnet-stack ps | Lists the dotnet processes that stack traces can be collected from. |
dotnet-stack symbolicate | Get the line number from the Method Token and IL Offset in a stacktrace. |
Prints the stack trace for each thread in the target process.
dotnet-stack report -p|--process-id <pid>
-n|--name <process-name>
[-h|--help]
-n, --name <name>
The name of the process to report the stack from.
-p|--process-id <PID>
The process ID to report the stack from.
Lists the dotnet processes that stack traces can be collected from.
dotnet-stack
version 6.0.320703 and later versions also display the command-line arguments that each process was started with, if available.
dotnet-stack ps [-h|--help]
Suppose you start a long-running app using the command dotnet run --configuration Release
. In another window, you run the dotnet-stack ps
command. The output you'll see is as follows. The command-line arguments, if any, are shown in dotnet-stack
version 6.0.320703 and later.
> dotnet-stack ps
21932 dotnet C:\Program Files\dotnet\dotnet.exe run --configuration Release
36656 dotnet C:\Program Files\dotnet\dotnet.exe
Get the line number from the Method Token and IL Offset in a stacktrace.
dotnet-stack symbolicate <input-path> [-d|--search-dir] [-o|--output] [-c|--stdout] [-h|--help]
-d, --search-dir <directory1 directory2 ...>
Path of multiple directories with assembly and pdb.
-o, --output <output-path>
Output directly to a file.
-c, --stdout
Output directly to a console.
> cat stack.trace
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at DotnetStackSymbolicate.App.MethodA() in DotnetStackSymbolicate.dll:token 0x6000002+0x6
at DotnetStackSymbolicate.App..ctor() in DotnetStackSymbolicate.dll:token 0x6000003+0x51
at DotnetStackSymbolicate.Program.OnCreate() in DotnetStackSymbolicate.Tizen.dll:token 0x6000001+0x8
onSigabrt called
>
> dotnet-stack symbolicate stack.trace --stdout
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at DotnetStackSymbolicate.App.MethodA() in C:\DotnetStackSymbolicate\DotnetStackSymbolicate.cs:line 19
at DotnetStackSymbolicate.App..ctor() in C:\DotnetStackSymbolicate\DotnetStackSymbolicate.cs:line 38
at DotnetStackSymbolicate.Program.OnCreate() in C:\DotnetStackSymbolicate.Tizen\DotnetStackSymbolicate.Tizen.cs:line 12
onSigabrt called
Output: stack.trace.symbolicated
To report managed stacks using dotnet-stack
:
Get the process identifier (PID) of the .NET Core application to report stacks from.
tasklist
command, for example.ps
command.Run the following command:
dotnet-stack report --process-id <PID>
The preceding command generates output similar to the following:
Thread (0x48839B):
[Native Frames]
System.Console!System.IO.StdInReader.ReadKey(bool&)
System.Console!System.IO.SyncTextReader.ReadKey(bool&)
System.Console!System.ConsolePal.ReadKey(bool)
System.Console!System.Console.ReadKey()
StackTracee!Tracee.Program.Main(class System.String[])
The output of dotnet-stack
follows the following form:
#
.Thread (<thread-id>):
.Module!Method
.[Native Frames]
in the output.# comment
Thread (0x1234):
module!Method
module!Method
Thread (0x5678):
[Native Frames]
Module!Method
Module!Method
Märkus
Stopping the process can take a long time (up to several minutes) for very large applications. The runtime needs to send over the type and method information for all managed code that was captured to resolve function names.
Toote „.NET“ tagasiside
.NET on avatud lähtekoodiga projekt. Tagasiside andmiseks valige link:
Sündmused
17. märts, 21 - 21. märts, 10
Liituge sarjaga, et luua muude arendajate ja ekspertidega skaleeritavad tehisintellektilahendused, mis põhinevad reaalajas kasutusjuhtumitel.
Registreeruge koheKoolitus
Moodul
Interactively debug .NET apps with the Visual Studio Code debugger - Training
Learn how to efficiently debug your .NET app by using Visual Studio Code to fix your bugs quickly. Use the interactive debugger within Visual Studio Code to analyze and fix your C# applications.