Cannot run IIS site locally

u7ername 1 Reputation point
2021-06-10T10:07:34.84+00:00

Just took over a new site techleader built with asp.net and IIS. The solution builds fine in VS, but got this error when trying to run the site locally in debug mode via VS2019 (start debugging) on Win10. Before the error appears, it says "some remote operation is taking longer than expected", somehow this indicates that it's trying to connect to a remote machine. I spent quite some time searching about this error and have seen there are some posts about the same/similar errors but none of solutions works for me. Guess there must be something that is not setup correctly somewhere (most likely in IIS).

104229-dyoxz.png

One of the suggested solutions is editing the hosts file in C:\windows\system32\drivers\etc, which I did add enter an entry: 127.0.0.1 http://cbuk.com but it didn't help.

This is the project property Web tab:

104217-r0oxq.png

In IIS, I created an app pool called 'cbuk' and set it to classic mode, logging in as NetworkService.

This is the binding for the site in IIS:

104137-rmwti.png

Have spent a lot of time on this; some help would be appreciated.

Windows development | Internet Information Services
Developer technologies | ASP.NET | ASP.NET Core
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Duane Arnold 3,216 Reputation points
    2021-06-10T10:47:09.263+00:00

    Is UAC enabled and are you running Visual Stuido with UAC admin rights? Did you configure VS to create the virtual directory that would have hooked everything up right app pool and all so VS Web project can be debugged out on IIS?

    https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-enable-debugging-for-aspnet-applications?view=vs-2019

    I would let VS hook everything up out on IIS for the Web project debugging hosted by IIS. Anything you have done out on IIS, you need to undo. VS must be running with admin rights to create the virtual directory on IIS.

    0 comments No comments

  2. AgaveJoe 30,126 Reputation points
    2021-06-10T11:17:27.747+00:00

    You might need to meet with your peers to understand the intention.

    Visual Studio is configure to open http://cbuk.com. We cannot determine from the URL if the site is local or remote. What happens when you try to open http://cbuk.com in your browser? Does the site open? What if you comment the entry in the hosts file, does the site open?

    Let's assume http://cbuk.com opens and the site is intended to run in local IIS. Make sure you are running Visual Studio and an administrator. Right click run as administrator. Check Windows Fire wall to make sure the port 4024 is open as the error warns. Make sure remote debugging is installed. Try attaching to the site instance. See the following docs for troubleshooting steps.

    https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugger-port-assignments?view=vs-2019
    https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging?view=vs-2019

    Maybe just use IIS Express?

    0 comments No comments

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.