Performance Analysis on .NET Core applications with PerfView (on Windows)

Back in July, the .NET Runtime Team shipped the first official version of .NET Core.    .NET Core is a stand-alone down version of the .NET Runtime that is Open Source (it lives in the .NET Core GitHub Repo) and cross platform (runs on Windows, OSX and a variety of Linux distributions).     Version 5 of ASP NET Web framework uses .NET runs on .NET Core (as well as the Desktop .NET Framework), and allows those web services to be run on Linux if desired.    You can also build ‘console’ applications that can do all sorts of tasks.   The links above describe how to actually build things with this new framework.

Once you have done this, inevitably,  you will want to do performance analysis on your .NET Core app, and as you would expect, PerfView can help you there.

Generally speaking, PerfView should ‘just work’ with .NET Core (on Windows), and the investigation the normal documentation works just as you would expect.      In  particular you can use PerfView to collect CPU samples and you should be able to see all your code displayed symbolically as you would expect.     Pretty much any investigation on .NET Core works like it would if you were running on the .NET Desktop framework.

There is a slight caveat in the short term however:

If  you want to look inside the .NET Core framework, and see the symbolic names of .NET Framework code, that also works fine (it looks the necessary symbolic information up on standard Microsoft symbol servers) IF you are NOT using pre-release versions of the code.

For the next few months, however (10/2016 through 3/2017) if you go to the .NET Core Site for getting started on windows, you will find it probably DOES point you at prelease code.    What his means is that you may not get symbolic information for .NET Framework code.

If you need to see these methods, there is a work-around.

  1. Open an Administrative command prompt
  2. Start PerfView with the command  ‘PerfView /ForceNGENRundown /BufferSizeMB=256

And use that to collect the data.   What this does is force the Runtime to dump symbolic information (NGEN Rundown) for managed code instead of trying to look up that data using Microsoft’s symbol servers.    This allows PerfView to display symbols for ANY managed code you use (including the framework) and works around this problem.

Sometime between now and 3/2017 we will make it so that even Prerelease versions of .NET frameworks will have the correct information on the symbol servers, but we are not there yet.   Until then, this is a useful work-around.

Comments (0)

Skip to main content