To write this article I was using Development-time IIS support in Visual Studio for ASP.NET Core.

First in Visual Studio installer enable development-time IIS support in Visual Studio:

Create new Asp.Net Core MVC application.

Add application to IIS, as physical path in my case I added "C:\Users\pera\Documents\Visual Studio 2017\Projects\WebApplication1\WebApplication1":

In Visual Studio right click on project go to properties:

Go to Debug, click on new:

In profile name write IIS:

Launch: IIS, Select the check box for Launch browser: http://test:2021/, the Environment variables section, select the Add button. Provide an environment variable with a Name of ASPNETCORE_ENVIRONMENT and a Value of Development:

Restart Visual Studio as administrator, if you haven't already.

Set the Start Debugging button to the IIS profile and select the button to start the app: