none
How to force VS 2012 to use specific host IP for network debugging? RRS feed

  • Question

  • Hi,

    My problem is similar to these two (which remain unsolved):
    http://social.msdn.microsoft.com/Forums/en-ZA/wdk/thread/6ed4ebc4-4d27-48fc-bc6b-fe6c7958e100
    http://social.msdn.microsoft.com/Forums/en-US/wdk/thread/18855189-55d8-4390-abd0-01df8164d69c

    I just tried to follow the tutorial at
    http://msdn.microsoft.com/en-us/library/windows/hardware/hh439654%28v=vs.85%29.aspx
    configured, provisioned, etc, then pressed F5, deployment appeared to work OK, but then debugger was stuck permanently with status "Waiting to connect to target".
    After a long investigation I found that
    bcdedit /dbgsettings
    on target prints
    hostip x.x.x.x
    which is NOT my main Ethernet IP on host, but one of numerous virtual adapters, which I happen to have.
    Why VS grabbed this IP?
    I cannot find anywhere in project properties or other settings any place to specify my real IP.
    Note that if I execute on target
    bcdedit /dbgsettings net hostip:y.y.y.y port:50000
    where y.y.y.y is my real host IP, then reboot the target, then I can use in VS Debug | Attach to process (after killing ntkd.exe) and debugger attaches OK.
    But the next time I press F5 to finish the tutorial, it again overwrites hostip on target with the junk IP.
    How can I stop it from doing such a stupid thing?

    Thank you
    Tuesday, January 22, 2013 11:43 PM

Answers

All replies

  • You need to change the "Host IP" field in the computer configuration wizard. See this page:<o:p></o:p>

    http://msdn.microsoft.com/en-us/library/windows/hardware/hh439353(v=vs.85).aspx<o:p></o:p>

    You will need to select "Provision computer and choose debugger settings"<o:p></o:p>



    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, January 23, 2013 3:50 AM
  • Thank you for your response,
    but it does not appear to work.
    I selected driver Package -> Properties -> Driver Install, Deployment,
    Target computer name, entered my target computer name,
    pressed "..." button, "Computer Configuration", Next,
    "provision computer and choose debugger settings" (option 2)
    It already had my main host PC adapter IP: 192.168.0.99
    I pressed Next and waited for provisioning to finish.
    There were no errors.
    At this time I executed on target:
    bcdedit /dbgsettings
    key                     ....
    debugtype               NET
    hostip                  192.168.0.99
    port                    50000
    dhcp                    Yes
    The operation completed successfully.

    So far, so good.

    But then I pressed F5.
    I saw that it executed 2 scripts on target in command windows
    and then prompted to restart the target.
    At this time I executed on target:
    bcdedit /dbgsettings
    key                     ...
    debugtype               NET
    hostip                  192.168.196.1
    port                    50000
    dhcp                    Yes
    The operation completed successfully.

    Here is the bug.
    F5 found somewhere this erroneous IP address 192.168.196.1 and reconfigured the target.
    After the target restarted this wrong hostip remained and debugger cannot attach.

    So, the question remain, where VS2012 got that bad IP address and how to force it to use
    the good one, which was provided during Computer Configuration?

    Saturday, January 26, 2013 2:43 AM