3.7 KiB
title | author | description | manager | ms.author | ms.custom | ms.date | ms.prod | ms.technology | ms.topic | uid |
---|---|---|---|---|---|---|---|---|---|---|
Development-time IIS support in Visual Studio for ASP.NET Core | shirhatti | Discover support for debugging ASP.NET Core apps when running behind IIS on Windows Server. | wpickett | riande | mvc | 09/13/2017 | asp.net-core | aspnet | article | host-and-deploy/iis/development-time-iis-support |
Development-time IIS support in Visual Studio for ASP.NET Core
This article describes Visual Studio 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.
Prerequisites
Enable IIS
Enable IIS. Navigate to Control Panel > Programs > Programs and Features > Turn Windows features on or off (left side of the screen). Select the Internet Information Services checkbox.
If the IIS installation requires a restart, restart the system.
Enable development-time IIS support
Launch the Visual Studio installer. 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. This installs the ASP.NET Core Module, which is a native IIS module required to run ASP.NET Core apps.
Configure the project
Create a new launch profile to add development-time IIS support. In Visual Studio's Solution Explorer, right-click the project and select Properties. Select the Debug tab. Select IIS from the Launch dropdown. Confirm that the Launch browser feature is enabled with the correct URL.
Alternatively, manually add a launch profile to the launchSettings.json file in the app:
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iis": {
"applicationUrl": "http://localhost/WebApplication2",
"sslPort": 0
}
},
"profiles": {
"IIS": {
"commandName": "IIS",
"launchBrowser": "true",
"launchUrl": "http://localhost/WebApplication2",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Visual Studio may prompt a restart if not running as an administrator. If prompted, restart Visual Studio.