Publishing an ASP.NET Core website with WebDeploy
In this article I'll show how to set up automatic deployment of your ASP.NET website to IIS 8.5 using Visual Studio 2017 and Windows Server 2012R2.
1. First go to the Web Platform Installer and install Web Deploy 3.6.
2. Then in Services make sure that Web Managment Service is running.
3. Next go to IIS and click on the website you want to publish. Open IIS Manager Permissions.
4. Select Windows account under which you will publish. Click "Allow User". To keep things simple I selected administrator's account. Click OK.
5. Right click website and go to Deploy ⇒ Configure Web Deploy Publishing.
6. Select user and specify the location where you want to save publishing settings. Click Setup.
7. Now in Visual Studio right click on your project and select Publish.
8. Choose IIS, FTP, etc.
9. Enter your credentials and click Next.
10. Click Save.
11. As you have seen there was no way to specify the name of the created profile. And I couldn't find any way to rename it from Visual Studio myself. To rename the profile do the following: go to /Properties/PublishProfiles folder and rename *.pubxml and *.pubxml.user files into whatever you like.
I renamed those files into "PublishToIISProfile".
12. Now you have everything set and can click Publish to publish your website.