Profiling ASP.NET Core applications running on IIS Express
Published 18 November 2020
IIS Express is a free version of IIS, commonly used in development environments. IIS Express can run on development machines without requiring the installation of a full web server, and does not require an administrator account to run. This makes it convenient for testing debug builds of web applications.
You can profile sites running on IIS Express by following the instructions below.
Setting up the Performance Profiler
Option 1: Manually selecting application to profile
If your application is not available via the applicationhost.config file, you can configure it manually.
- From the list of application types, click IIS Express - ASP.NET Core.
- Provide a path to your web application's assembly file (.dll or .exe) in the ASP.NET Core assembly field.
Provide a path to your web application's working directory in the Application path field. For published applications this is usually the same directory where the assembly file is located. For debug builds this is usually your project directory.
If the Application path field is not visible, click Profile an application not shown in this list.
- If required, you can set the Port, Protocol, Start page, and preferred CLR version by clicking Show advanced options, or set Environment variables and run the app as 32-bit by clicking Show startup options:
- Select the required Profiling mode, Chart performance counters, Additional profiler options, and the browser to launch the application.
For more information, see Choosing application types and settings and Setting up chart performance counters.
Note that SQL queries and incoming HTTP calls will be profiled automatically. - Click
Option 2: Profiling applications already configured in applicationhost.config file
You can profile websites already installed to your default applicationhost.config file or provide the path to your own configuration file.
- From the list of application types, click IIS Express - ASP.NET Core.
Confirm that a correct path to applicationhost.config file is provided in the Configuration file field.
If you want to profile a previously debugged website, you can use a config file generated by Visual Studio. This file is usually located in a hidden .vs directory in your solution folder, e.g. C:\SolutionDirectory\.vs\SolutionName\config\applicationhost.config.If the Configuration file field is not visible, click Choose an application already hosted in IIS Express.
When the configuration file is selected, ANTS Performance Profiler will list all available applications in a Site dropdown list. Select a desired application from the list.
If no websites are visible on the list you may need to provide the site's details manually (see Option 1).
- Depending on the information contained in the applicationhost.config file, ANTS Performance Profiler will attempt to automatically fill-in the ASP.NET Core assembly field.
If the ASP.NET Core assembly field remains empty, you must manually locate the assembly file (.dll or .exe) of your web application. - If required, you can set the Start page, Environment variables, and run the app as 32-bit by clicking Show startup options:
- Select the required Profiling mode, Chart performance counters, Additional profiler options, and the browser to launch the application.
For more information, see Choosing application types and settings and Setting up chart performance counters.
Note that incoming and outgoing HTTP requests will be profiled automatically. - Click
IIS Express starts and the web application is shown in your default browser. During a profiling session you can interact normally with your application and with the profiler.
When you have finished interacting with your web application, click the button in ANTS Performance Profiler to stop profiling.
This closes the ASP.NET Core application. ANTS Performance Profiler shows all of the profiling data collected for the application.
Closing the browser window does not cause profiling to stop.