0

This isnt my first project with WinIoT on a Pi. I have been using the WinIot image since its first version. I decided to update all my Pis to the latest WinIoT image. My VS is updated to the latest version 2017 15.15.2.

When I go to remote debug my application, It fails during the deploy process with this error:

1>Error: Unable to connect to the Microsoft Visual Studio Remote Debugger named '[iphere]'.  The Visual Studio 2017 Remote Debugger (MSVSMON.EXE) does not appear to be running on the remote computer. This may be because a firewall is preventing communication to the remote computer. Please see Help for assistance on configuring remote debugging.

So I go onto the WinIot image, and click on the "Start Remote debugger" and it returns this text:

enter image description here

Failed to start the Visual Studio Remote Debugger. The Remote Debugger needs to be copied to the device. This can be done by deploying an application to the device using Visual Studio.

So, then I follow the link listed, and its basically just instructions on how to do what I am doing... exactly. https://learn.microsoft.com/en-us/windows/iot-core/develop-your-app/AppDeployment

I have spent hours on this and am getting nowhere. It seems that MS now has VS put up its remote debugger, but for some reason its not working.

Debug Profile: enter image description here

Things I have checked:

  • Windows Firewall off
  • Reinstalled the WinIot Image to start fresh
  • Started a fresh UWP project with no code in it
  • Set build verbosity high, but did not have issues on the build, only the deploy
  • Added the WinIoT image to my trusted hosts with the windows powershell commands
  • Was able to remote in with PowerShell, no issue there.
  • Disabled IPv6 on my PC (pings were showing IPv6 when pinging the host name)

Things I have noticed:

  • When I first was able to get this to work, I saw that the instructions on MSDN are showing "Universal" for Authentication - When I select from the list of available Pi3, it moves it back to 'None' at one point, I was able to deploy and debug with 'None', but now even now that does not work.
  • MSDN Instructions online seem to be dated with commands that are no longer available to run such as how to start the remote debugger -
  • Cant seem to find a way to put the remote debugger on and manually start it (if that would even work)

I feel that because I was able to do this before, in the last week on this image version, that there must be something environmental, but I have exhausted my time trying to figure it out I would rather be coding instead of debugging the debugging process.

Any assistance is greatly appreciated.

TravisWhidden
  • 2,142
  • 1
  • 19
  • 43

1 Answers1

1

you should not disable ipv6 in modern Windows. It may have been acceptable in XP-days, but now it will really mess up your system. See this post for more info and re-enable it. Start with a fresh image on your Raspberry pi if possible. Then you should clear your cached credentials on your user profile, open a command prompt and type in:

rundll32.exe keymgr.dll, KRShowKeyMgr

As you can see in the following picture, you should delete everything with minwinpc, or the device's hostname/ip address

enter image description here

Next you need to create a new, dummy c# iot project using one of the templates downloaded from Visual Studio Marketplace

enter image description here

Now Right Click the project and choose properties

enter image description here

Enter the debug information as shown below. It should use unencrypted protocol

enter image description here

Click Remote Windows Debugger

enter image description here

The operation will take some time

enter image description here

Eventually it will time out (this is ok)

enter image description here

Check to ensure that the application was deployed

enter image description here

If the app wasn't deployed, then you have further problems with your pc's / vs configuration that need to be repaired. The quickest method to repair this is to blow away your user profile on the local pc, but you should only do this as a last resort, as you will have to re-import your browser favorites, network drives and e-mail settings.

Assuming the deployment of the dummy solution worked, then connect to the device using powershell and issue these commands

cd c:\data\users\defaultaccount\appdata\local\developmentfiles\vsremotetools
netsh advfirewall firewall add rule name="Remote Debugging TCP Inbound" dir=in action=allow protocol=TCP localport=4022
netsh advfirewall firewall add rule name="Remote Debugging TCP Inbound" dir=in action=allow protocol=TCP localport=4023
netsh advfirewall firewall add rule name="Remote Debugging UDP Inbound" dir=in action=allow protocol=UDP localport=3702
(Start-Process -FilePath "xcopy" -ArgumentList "*.* c:\temp\rdbg /y /s /i /d /h" -Wait -Passthru).ExitCode
(Start-Process -FilePath "c:\temp\rdbg\arm\msvsmon.exe" -ArgumentList "/silent /nostatus /nosecuritywarn /nofirewallwarn /noclrwarn" -Wait -Passthru).ExitCode

You should see msvsmon running if you browse to http://minwinpc:8080/#Debug (as shown below) enter image description here

Now this time, change the remote debugging settings in the visual studio project to Windows authentication enter image description here

then click Start Remote Debugging

Whyan
  • 134
  • 1
  • 6
  • That looks like a little older version of the Wynn iot. Have you tried this procedure on the new version that was just released? – TravisWhidden Dec 23 '17 at 22:10
  • Just curious why your user interface is different in your screen shots.. mine looks like this: http://take.ms/CXlgl – TravisWhidden Dec 24 '17 at 07:15
  • I have updated the screenshot to the 16299 ui. I have a procedure that I follow, which was developed from 10586 so that is why the old screenshot was there. – Whyan Dec 24 '17 at 13:18
  • ugg.. the solution was so much easier. Add this in, and ill mark your answer... it does good ideas: http://take.ms/UyQVt – TravisWhidden Dec 25 '17 at 16:31
  • Can you suggest me what to do... Your solution don't works for me: https://stackoverflow.com/questions/54723792/failed-to-connect-to-device-192-168-1-17-using-universal-authentication – Olga Pshenichnikova Feb 16 '19 at 15:58
  • Hi Olga it looks like Microsoft has changed the way windows iot works in the latest builds (1809). It looks like they have swapped out most of the ws-management default functionality in favor of ssh. Unfortunately I cannot amend my answer given above for your question as it is best suited for the windows iot configuration stated in the question by travis. Hopefully someone will be able to answer your question separately. – Whyan Feb 17 '19 at 16:30