Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bind debugger to all IP Addresses instead of only localhost

How can I make visual studio asp.net debugger to bind to all ipaddresses of my network instead of localhost? So I can debug under another circumstances.

like image 614
EBAG Avatar asked Dec 29 '22 03:12

EBAG


1 Answers

For IIS Express, grant yourself permission to bind to both localhost and wildcard network adapters, and configure IIS Express to bind to them.

Step details: (they assume a port number of 5555 - use your actual port instead)

  1. Run these commands from a command prompt as Administrator:

    netsh http add urlacl url=http://localhost:5555/ user="NT AUTHORITY\INTERACTIVE"
    netsh http add urlacl url=http://*:5555/ user="NT AUTHORITY\INTERACTIVE"
    
  2. In %USERPROFILE%\Documents\IISExpress\config\applicationhost.config, add a wildcard binding to your site. The result should look like this:

    <site name="..." id="...">
        <!-- application settings omitted for brevity -->
        <bindings>
            <binding protocol="http" bindingInformation="*:5555:localhost" />
            <binding protocol="http" bindingInformation="*:5555:*" />
        </bindings>
    </site>
    
like image 153
Edward Brey Avatar answered Dec 30 '22 18:12

Edward Brey