I have a demo SharePoint server with multiple web applications created. Each of them has a host header that is entered into company's DNS. All the web applications are on port 80.
I changed SiteURL property in Visual Studio, but when trying to deploy Visual Studio shows this error:
Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site: http://appname.company.local/. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project.
Visual Studio is installed on the demo server.
UPDATE After tinkering a bit around central admin and AAM and deploying through PSH, I accidentally deployed through VS again, and this time it worked. I have no idea what happened.