this started happening suddenly.

In a Visual Studio 2022 solution I have 2 .NET Core projects which are web applications.

Both are configured to run in IIS Express.

launchSettings.json of "Project A" contains this:

{
  "profiles": {
    "http": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "dotnetRunMessages": true,
      "applicationUrl": "http://localhost:5164"
    },
    "https": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "dotnetRunMessages": true,
      "applicationUrl": "https://localhost:7190;http://localhost:5164"
    },
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "ancmHostingModel": "OutOfProcess"
    }
  },
  "$schema": "https://json.schemastore.org/launchsettings.json",
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "https://localhost:59140",
      "sslPort": 44369
    }
  }
}

And that file of "Project B" contains this:

{
  "profiles": {
    "http": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "dotnetRunMessages": true,
      "applicationUrl": "http://localhost:5191"
    },
    "https": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "dotnetRunMessages": true,
      "applicationUrl": "https://localhost:7255;http://localhost:5191"
    },
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "ancmHostingModel": "OutOfProcess"
    }
  },
  "$schema": "https://json.schemastore.org/launchsettings.json",
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "https://localhost:59150",
      "sslPort": 44375
    }
  }
}

The problem is that when I try to debug "Project B", the error An error occurred attempting to determine the process ID which is hosting your application. An error occurred while sending the request. is shown.

When I run "Project A", it is run without problems. Browser opens and the home page is shown.

By running the command netsh http show sslcert I can see that 44375 port is listed.

Furthermore, if I run "c:\Program Files\IIS Express\iisexpress.exe" /config:applicationhost.config /site:MySite, IIS Express starts without problems when I have this binding in applicationHost.config file:

    <bindings>
      <binding protocol="https" bindingInformation="*:59150:localhost" />
    </bindings>

Starting IIS Express ... Successfully registered URL "https://localhost:59150/" for site "EntryPortal.Core" application "/" Registration completed for site "EntryPortal.Core" IIS Express is running. Enter 'Q' to stop IIS Express

If I change binding to 44375 port, ths error is shown:

Starting IIS Express ... Failed to register URL "https://localhost:44375/" for site "EntryPortal.Core" application "/". Error description: El proceso no tiene acceso al archivo porque estß siendo utilizado por otro proceso. (0x80070020) IIS Express is running. Enter 'Q' to stop IIS Express

Even when there is no other process listening on that port.

How can I solve it?

0

There are 0 best solutions below