In the past I ran Mono on the original PI but with the Windows IoT Core and Universal Windows Projects, I thought I'd get back into programming on these small devices as I find it oddly satisfying. However there are always teething problems, one that cost me a bit of time was trying to deploy to the PI (I'm using a Raspberry PI 2 Model B) from Visual Studio 2017.

I got a bunch of errors such as:

  • Failed to deploy package SomePackage: Access denied to path on the device 'SomePath'.
  • I also got a SmartDeviceException: Device not found.

One of the missing files was:
'C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\VSRemoteTools\msvsmon.exe'.
For some reason these files hadn't been copied over.

One of the issues was I hadn't setup permissions on my device properly. You have to tell the PI to trust your development PC for deployment. Here's the PowerShell to do this:

#PowerShell
Enter-PSSession -ComputerName 192.168.1.10 -credential 192.168.1.10\administrator
Set-Item WSMan:\localhost\Client\TrustedHosts -Value 192.168.1.10

For the second issue, I just copied over the files I could find from the installed SDK's.
I created a folder on the PI at:
c$\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\VSRemoteTools

I then copied files from my development PC from:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\CoreCon\Binaries\Phone Tools\Debugger\target\armv4i
There were a couple of other locations I found other files in, such as the TailoredDeploy.exe and msvsmon.exe.

One thing to note here, initially I misread the path, and was copying the files to:
c$\Users\Default\AppData\Local
When in actual fact, Visual Studio was looking in:
c$\Data\Users\DefaultAccount\AppData\Local

After resolving these 2 issues, my project happily deployed and I was up and running. Coolness :)