Exploring Prefix: A Free ASP.NET Profiling Tool

4.5 (12 votes)

Prefix is a free profiler for ASP.NET applications. It's dead easy to use and it will help you find bugs in your code that you didn't even know you had. I found two in what I thought were properly working apps within an hour of downloading Prefix.

Prefix is developed by a company called Stackify, who also do some heavy-weight application performance monitoring kit. The Prefix download is a standard msi so it is easy to install, and once installed, it runs in the background and is available from the system tray.

Stackify Prefix

Prefix uses a browser for its UI. When you click on the system tray icon, the notification lets you know that it is waiting for new web requests to profile.

Stackify Prefix

It is not immediately clear whether the profiler has been enabled as both the Enable Profiler and Disable Profiler buttons appear in the same indeterminate state. However, as soon as you fire an application up in IIS Express, you can see whether it is being profiled:

Stackify Prefix

Each individual request is monitored. In the image above, you can see an Intranet application being started. The default home page is initially requested, and the response is a 302 redirect to the login page. This happens to be an MVC application, but Prefix works with Web Forms and Razor Web Pages applications just as well. ASP.NET Core support is coming soon, we are promised.

The left hand side of the screen shows each request, with the time it took, the response status, the number of database calls the request required and the number of uncaught exceptions (if any).

Stackify Prefix

The right hand side of the screen allows you to drill down into the detail of each request. For example you can examine the request headers:

Stackify Prefix

You can get this type of detail from any browser extension, but what you can't get from there is a breakdown of the compilation time and the modules and handlers in the request pipeline such as the following example that features a request to a Web Forms application:

Stackify Prefix

You also get a visual breakdown of what resources are being used most during page execution:

Stackify Prefix

Prefix captures the command text that's executed against the database. In the image above, you can see a stored procedure called GetFeaturedSupplier taking 1.335 seconds to execute. At the moment, it doesn't monitor parameter values, but that feature is being added. Being able to see the command text is particularly useful if you are using Entity Framework because you can you examine the generated SQL easily:

Stackify Prefix

A nice feature is the Download Query Result counter (in the yellow box above), which tells you how much of the database call time was used for transferring the resulting data, as opposed to executing the actual query.

The details pane shows particularly expensive operations with a different colour background:

Stackify Prefix

In this particular case, the view compilation took most time. While that's a one-off cost, it could be worth considering precomiling the views. The point is that Prefix details exactly what it is that you should be focusing on to improve performance.

As to the bugs that Prefix helped me identify, one was the same stored procedure being called twice in the same page in a Web Forms application. This was caused by the fact that I had changed some code to explicitly call the Select method of a SqlDataSource control in code behind while the control was still bound to a ListView, resulting in the Select method being fired twice. The other bug was an Action being fired twice in quick succession (which wasn't noticeable in production) resulting in an unnecessary extra 12 calls to the database:

Stackify Prefix

On closer examination, it was clear from the request headers that the second request was being initiated by AJAX. The culprit was a mistake in some jQuery code, where AJAX caching was incorrectly configured as follows:

$.ajax({ cache: false });

instead of

$.ajaxSetup({ cache: false });

The original code will of course result in an asynchronous call being generated.


Prefix is a very useful tool for seeing exactly what is going on within your ASP.NET application during development. It is extremely lightweight and is easily accessible from the system tray. It will help you identify any potential processing bottlenecks, as well as hidden bugs. It's definitely become part of my toolkit.

Date Posted:
Last Updated:
Posted by:
Total Views to date: 10671


- Matt Watson

Glad you are loving it!

Matt from Stackify

- Jon

We had the exact same experience, finding multiple bugs in an application that we thought was running pretty smoothly, within minutes of beginning to use Prefix! Nice write up on a welcome new addition to the .NET community's toolbelt!

- satyabrata

This is great!!!!!

- Darren Evans

'Tis indeed a marvellous thing. Just waiting on its appearance for ASP.NET Core. Hopefully not long now. I see there's already a StackifyMiddleware Nuget package ready and waiting.

Thanks to the Stackify code monkeys for this great tool.

- Avinash Setty

This tool is awesome! I am very thankful for introducing this tool for us! By any chance, do you know whether this tool is worthy to install it on Production servers? Also, by default Prefix captures the requests for last 5mins, do you know how to extend this?

Recent Comments

Thomas 05/03/2018 00:59
In response to I'm Not Writing A Book On Razor Pages
There's a typo on this page: = true)] should be [BindProperty(SupportsGet = true)]...

Rolf Herbert 04/03/2018 19:25
In response to I'm Not Writing A Book On Razor Pages
So is MS deprecating razor Web Pages..? Is it dead..? I wish they would stop killing things so its...

Borut 17/02/2018 12:59
In response to I'm Not Writing A Book On Razor Pages
Mike, is it possible that Web Pages and Razor Pages "live" together in one web application? I a I...

hrboyce 09/02/2018 04:44
In response to I'm Not Writing A Book On Razor Pages
Mike, First thanks for doing this but I have to ask, any chance you would consider converting one of...

aziz sallam 07/02/2018 10:18
In response to I'm Not Writing A Book On Razor Pages
u are a great man...

Satyabrata Mohapatra 31/01/2018 11:36
In response to I'm Not Writing A Book On Razor Pages
This is a great news!!!! Thanks...

tangdf 30/01/2018 07:25
In response to I'm Not Writing A Book On Razor Pages
=> { o.ConfigureFilter(new IgnoreAntiforgeryTokenAttribute()); }); The extension method does...

Obinna Okafor 30/01/2018 04:02
In response to I'm Not Writing A Book On Razor Pages
Thank you very much. I would like to see a project built from scratch using Razor Pages. And it show...

rachida Dukes 31/10/2017 13:52
In response to Customising Identity in Razor Pages
Thanks again for this wonderful tutorial. I followed all the steps in this section called: Adding...

Rachida 31/10/2017 12:06
In response to Customising Identity in Razor Pages
Thanks very much for this wonderful tutorial, it helped a lot....