Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.net core - Unable to connect webserver 'IIS Express'

i changed my launch setting to suppport remote ip hosting

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://192.168.1.69:55446/",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "myapplication": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "http://localhost:5000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

it works well in my system.

then i download my project from tfs in another remote system and changed the ipaddress to support remote ip hosting and run the application in adminstrator mode..but still it showing "Unable to connect webserver 'IIS Express'"

 {
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://192.168.1.79:55446/",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "eBMSForumApplication": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "http://localhost:5000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}
like image 939
raj Avatar asked Dec 08 '16 12:12

raj


Video Answer


2 Answers

If you see something like this in the output console:

IIS Express starting...
iis express Failed to register URL "http://localhost:61367/" for site application "/". 
Error description: The process cannot access the file because it is being used by 
another process

The error is due to the port you are using.

Open a console and check out used port ranges with this command:

netsh interface ipv4 show excludedportrange protocol=tcp

It will look like this:

enter image description here

Change the port number you wanna use, which is outside of those ranges.

like image 112
Peter Avatar answered Oct 13 '22 11:10

Peter


This problem is similar to https://stackoverflow.com/a/67990888/733760 and could be related to Hyper-v reserving a bunch of port ranges.

If that's the problem, the same answer applies (and worked for me). Run as admin:

net stop winnat
net start winnat
like image 29
AlexDev Avatar answered Oct 13 '22 11:10

AlexDev