How do you deploy ASP.NET Core Web API application to a local server?

579 Views Asked by At

The Web API is using .NET 6.0. The "server" is just an old desktop PC running Windows 10 Pro.

I'm trying to deploy using the Web Deploy method from Visual Studio 2022. I'm trying to follow this tutorial: https://www.youtube.com/watch?v=Lt3wve_nb0g

However, the code is being deployed to localhost.

The error I get is:

Web deployment task failed. (Could not connect to the remote computer ("192.168.1.xxx"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.

I've installed Web Deploy 3.6 on the server, however there doesn't seem to be a way to get Web Management Service going. Specifically the Management Service icon does not show up in IIS. From this answer: Web Platform and IIS CAN'T FIND MANAGEMENT SERVER it doesn't seem like it will show up in Windows 10.

I've also set up an account on the server that has read/write permissions to the deployment folder, although that has had no effect.

I can see the server on the network and can navigate via explorer to shared folders.

I've configured the publishing profile to use the server's IP with the correct port.

What am I missing?

1

There are 1 best solutions below

0
On

You missed the fact that the remote server must really be running Windows Server, not Windows 10. The streamlined experience was sadly only designed for Windows Server, as it relies on several server only features (IIS remote management API for instance).

Instead, set up a CI/CD system on your old Windows 10 Pro machine, so that you push changes via Git to that machine and trigger an automatic workflow to deploy to the IIS locally.