Debugging an ASP.NET MVC application on an Android phone

前端 未结 4 470
傲寒
傲寒 2020-12-13 05:26

Objective

I\'m looking for the simplest-possible, step-by-step setup process for debugging my ASP.NET MVC 4 application using my IP address as the U

相关标签:
4条回答
  • 2020-12-13 06:04

    I needed to perform all of the steps from the link that cfeduke provided. (Not just the one he describes in his answer.)

    1. Add <binding protocol="http" bindingInformation="*:58938:192.168.1.42" /> to applicationhost.config after the binding for 'localhost'.
    2. Run netsh http add urlacl url=http://192.168.1.42:58938/ user=everyone
    3. Run netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=58938 profile=private remoteip=localsubnet action=allow
    0 讨论(0)
  • 2020-12-13 06:14

    Grant yourself permission to bind to both localhost and wildcard network adapters, configure IIS Express to bind to them, and open the port on your firewall. By using a wildcard, you don't have to reconfigure when your IP address changes.

    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 .vs\config\applicationhost.config (or for pre-VS2015, %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>
      
    3. Open the firewall port for your IIS Express site. You can do this from an administrative command prompt:

      netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=5555 profile=private remoteip=localsubnet action=allow
      
    0 讨论(0)
  • 2020-12-13 06:24

    Give this a shot:

    netsh http add urlacl url=http://192.168.1.109:25968/ user=everyone
    

    From: http://johan.driessen.se/posts/Accessing-an-IIS-Express-site-from-a-remote-computer

    You might be able to substitute your computer's hostname for the IP address so you don't have to re-run that every time your IP changes.

    0 讨论(0)
  • 2020-12-13 06:24

    If you got Node.js on your machine Try this tool by: Ionut-Cristian Florescu

    https://github.com/icflorescu/iisexpress-proxy

    To install it just write on the command line npm install -g iisexpress-proxy

    Then check the port that you have in your project and map it to outer port. iisexpress-proxy [localPort] to [proxyPort]

    0 讨论(0)
提交回复
热议问题