Run and Debug ASP.NET Core Apps in IIS Express
Before you start
To host ASP.NET Core applications, IIS Express relies on the ASP.NET Core Module. If you have Visual Studio 2019 or later on your machine, this module is already installed.
Without Visual Studio, you need to install this module. To do so, install the required components in the following order:
Internet Information Services —.
You can check if you have the module in your IIS Express configuration file %PROGRAMFILES(x86)%\IIS Express\config\templates\PersonalWebServer\applicationhost.config . If there is at least one of the following lines, then you have the module installed:<add name="AspNetCoreModule"... <add name="AspNetCoreModuleV2"...
If everything is configured correctly, JetBrains Rider will automatically find all necessary components. You can check their paths on thepage of JetBrains Rider settings Ctrl+Alt+S:
After creating a new ASP.NET Core project or loading an existing one that has a launchSettings.json file with one or more IIS Express profiles, JetBrains Rider will automatically create run/debug configurations based on those profiles.
You can view and edit created configurations either in the Run/Debug Configurations dialog ( ) or on the toolbar selector:
For IIS Express profiles, the run configuration includes a few additional options:
|Generate applicationhost.config||To launch IIS Express with your ASP.NET Core application, JetBrains Rider uses a configuration file .idea/config/applicationhost.config, which is created using a template that ships with IIS Express. When possible, customizations you make to this file are also preserved. You might want to disable this option for heavy customizations.|
|Show IIS Express output||This option enables output from the IIS Express process. By default, it is disabled (as the output is quite verbose), but when enabled we can see additional details when running the application:|
|Send debug request|| When this option is enabled, JetBrains Rider will send an initial request (with a |
|Additional IIS Express arguments||This field lets you pass additional arguments to the IIS Express host (for example, to enable request tracing).|
As with other launchSettings-based run configurations, you can specify the target framework and additional runtime arguments using this dialog, but some IIS Express-specific options should be configured directly in the launchSettings.json file.
Run and debug
Once everything is installed and configured, you can run your project Shift+F10 or set breakpoints (even in application startup, for example in
ConfigureServices methods) and then debug your code Shift+F9.
Generate a self-signed SSL certificate
For launchSettings-based run configurations, JetBrains Rider will check whether an ASP.NET Core developer certificate or IIS Express self-signed certificate is set up on your machine. If not, you will see a notification which also let you generate one:
Setting up a certificate can be done from that warning, or with the Set up certificate action, which you can find using Find Action Ctrl+Shift+A.
For ASP.NET Core, JetBrains Rider will use the
dotnet dev-certs https command to check whether the certificate has been installed. For IIS Express, it will check the http.sys certificate settings (similar to the
netsh http show sslcert command line).
It also verifies the certificate is trusted by our system. This should make it easier to develop ASP.NET and ASP.NET Core web applications that make use of SSL on our developer machine.