How do I ensure that port 8172 is opened on the server, so I can deploy to it?

Rod At Work 866 Reputation points
2022-11-30T17:23:59.553+00:00

I have been trying to deploy a test version of an ASP.NET MVC Core app, which I wrote using .NET 6, onto a Windows 2019 Server. I've been trying for weeks, with no success. I tried using Azure DevOps Hosting agent on the server, but ran into difficulties because people at work aren't available to make changes to the firewall.

So, next I tried doing a deploying from VS 2022, using Web Deploy. I know that Web Deploy is on the server. I know that Web Management Service is running, set to run automatically. I'm getting errors in VS 2022 when I try to deploy to the server, telling me that the server is actively denying access. I can remote to the server fine, and I even have administrative privileges on the server. The last thing I've come across which might be the problem is port 8172, the default port used by Visual Studio when deploying to a web server, may not be opened. I've asked for help from the IT team two weeks ago, nothing has happened since.

How do I check to see if that port is open? And what steps do I take to open it, if it isn't opened?

Internet Information Services
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,263 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2022-12-01T15:12:43.023+00:00

    Well that doesn't really mean a firewall port is open. It simply means there is a local process listening on 8172. The 0.0.0.0 means listening on all adapters. If you wanted to test connectivity from a remote location you could Powershell

    Test-NetConnection -ComputerName "192.168.49.65" -Port 8172 -InformationLevel "Detailed"  
    

    then look for TcpTestSucceeded = True

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    4 people found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Sam Wu-MSFT 7,536 Reputation points Microsoft Vendor
    2022-12-01T03:57:17.607+00:00

    @Rod At Work

    I'm getting errors in VS 2022 when I try to deploy to the server, telling me that the server is actively denying access

    Can you post the complete error message?

    The last thing I've come across which might be the problem is port 8172, the default port used by Visual Studio when deploying to a web server, may not be opened

    Try to use the following command to see if there is port 8172 information:

    netstat -aon | findstr :8172  
    

    If not, your port 8172 is not open, you can try the following steps:

    1. Open IIS and in the center pane, under Management, double-click Management Service.
    2. In the center pane, select Enable remote connections.
    3. In the Actions pane, click Start to start the Web Management Service.
    4. If you're prompted to save your settings, click Yes.

    265991-capture.png

    By default, the IIS Web Management Service listens on TCP port 8172. If Windows Firewall is enabled on your web server, you'll need to create a new inbound rule to allow TCP traffic on port 8172 (all outbound traffic is permitted by default in Windows Firewall). For more information on configuring rules in Windows Firewall, see Configuring Firewall Rules.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Rod At Work 866 Reputation points
    2022-12-01T15:00:26.65+00:00

    Hello @Sam Wu-MSFT for your quick response. I opened a command prompt then issued the command you listed. It looks to me like port 8172 is open:

    266224-image.png

    So, that doesn't appear to me to be the problem.

    I did get into Management Service for the server in IIS. And I see the Enable remote connections is not checked. Furthermore, I cannot check it (it is disabled).

    So, this leads me to ask, is that enable remote connections necessary? If so, I'll have to get someone else to turn that on because I cannot.


  3. Rod At Work 866 Reputation points
    2022-12-01T15:45:18.933+00:00

    @Anonymous thank you for your response. I ran the PowerShell script you listed, on my dev box, against the target server's IP. I did find TcpTestSucceeded = True.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.