This article describes [Visual Studio](https://www.visualstudio.com/vs/) support for debugging ASP.NET Core apps running behind IIS on Windows Server. This topic walks through enabling this feature and setting up a project.
![Windows Features showing Internet Information Services check box checked as a black square (not a checkmark) indicating that some of the IIS features are enabled](development-time-iis-support/_static/enable_iis.png)
* A host name that matches the app's launch profile URL host name.
* Binding for port 443 with an assigned certificate.
For example, the **Host name** for an added website is set to "localhost" (the launch profile will also use "localhost" later in this topic). The port is set to "443" (HTTPS). The **IIS Express Development Certificate** is assigned to the website, but any valid certificate works:
![Add Website window in IIS showing the binding set for localhost on port 443 with a certificate assigned.](development-time-iis-support/_static/add-website-window.png)
If the IIS installation already has a **Default Web Site** with a host name that matches the app's launch profile URL host name:
* Add a port binding for port 443 (HTTPS).
* Assign a valid certificate to the website.
## Enable development-time IIS support in Visual Studio
1. Launch the Visual Studio installer.
1. Select the **Development time IIS support** component. The component is listed as optional in the **Summary** panel for the **ASP.NET and web development** workload. The component installs the [ASP.NET Core Module](xref:fundamentals/servers/aspnet-core-module), which is a native IIS module required to run ASP.NET Core apps behind IIS in a reverse proxy configuration.
![Modifying Visual Studio features: The Workloads tab is selected. In the Web and Cloud section, the ASP.NET and web development panel is selected. On the right in the Optional area of the Summary panel, there's a check box for Development time IIS support.](development-time-iis-support/_static/development_time_support.png)
For a new project, select the check box to **Configure for HTTPS** in the **New ASP.NET Core Web Application** window:
![New ASP.NET Core Web Application window with the Configure for HTTPS check box selected.](development-time-iis-support/_static/new-app.png)
In an existing project, use HTTPS Redirection Middleware in `Startup.Configure` by calling the [UseHttpsRedirection](/dotnet/api/microsoft.aspnetcore.builder.httpspolicybuilderextensions.usehttpsredirection) extension method:
```csharp
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseCookiePolicy();
app.UseMvc();
}
```
### IIS launch profile
Create a new launch profile to add development-time IIS support:
1. For **Profile**, select the **New** button. Name the profile "IIS" in the popup window. Select **OK** to create the profile.
1. For the **Launch** setting, select **IIS** from the list.
1. Select the check box for **Launch browser** and provide the endpoint URL. Use the HTTPS protocol. This example uses `https://localhost/WebApplication1`.
1. In the **Environment variables** section, select the **Add** button. Provide an environment variable with a key of `ASPNETCORE_ENVIRONMENT` and a value of `Development`.
1. In the **Web Server Settings** area, set the **App URL**. This example uses `https://localhost/WebApplication1`.
1. Save the profile.
![Project properties window with the Debug tab selected. The Profile and Launch settings are set to IIS. The Launch browser feature is enabled with an address of https://localhost/WebApplication1. The same address is also provided in the App URL field of the Web Server Settings area.](development-time-iis-support/_static/project_properties.png)