Windows 10 UWP–Migrating a Windows 8.1 App (Part 10 of N)

Hey? Landing here in 2016 following a Windows Developer Tweet? There is a later post;

Jump to the last post of the series and work back

Following on from this series of posts, it’s been a little while since I had a chance to continue rebuilding my QR code scanning app;

Windows 10 UWP–Migrating a Windows 8.1 App (Part 1 of N where N tends to infinity)

Windows 10 UWP–Migrating a Windows 8.1 App (Part 2 of N)

Windows 10 UWP–Migrating a Windows 8.1 App (Part 3 of N)

Windows 10 UWP–Migrating a Windows 8.1 App (Part 4 of N)

Windows 10 UWP–Migrating a Windows 8.1 App (Part 5 of N)

Windows 10 UWP–Migrating a Windows 8.1 App (Part 6 of N)

Windows 10 UWP–Migrating a Windows 8.1 App (Part 7 of N)

Windows 10 UWP–Migrating a Windows 8.1 App (Part 8 of N)

Windows 10 UWP–Migrating a Windows 8.1 App (Part 9 of N)

I thought it was about time that I started to think about making this application ‘universal’ in the sense of seeing what it was like to run it on a phone.

I knew that it was going to be ugly as I’d given phone no thought up until now but I flipped the switch and hit a couple of things straight away.

The first problem was that it seemed like I hadn’t built this code for ARM before or, if I had, I’d made significant changes since then because I’m using some /unsafe C# code and so I had to tweak my project settings as it looked like I hadn’t enabled /unsafe for the ARM builds.

That was easy enough to fix.

The second problem I got was much more of a head scratcher. This app (and project) originated on Windows 8.0 and then moved to 8.1 and then I migrated it to 10.0 in that first blog post.

When I tried to deploy the app to the phone (emulator or real device) I would find that I would get an error;

Severity    Code    Description    Project    File    Line
Error        Error : DEP0001 : Unexpected Error: Package could not be registered. (Exception from HRESULT: 0x80073CF6)

and I hadn’t a clue what to do with that one.

In the end, I resorted to the age-old trick of making a new, blank project and comparing the contents of the app manifest file in that project with the one in my project.

Sure enough, after a few experiments I realised that it was the PhoneProductId which was causing me a problem here. Mine was;

image

and that seemed to block the deployment.

I don’t remember exactly where this PhoneProductId came from – maybe I put it in there myself at some point but I found that replacing it with a random GUID seemed to fix the problem. Naturally, I need to come back and figure out exactly what value it should have in my scenario but, for now, I can run on the phone and so, hopefully, if you see the same problem at some point in the future you might land on this post and it might save you some wasted hours.

With the application now running on the phone – what was it looking like? In short, awful Smile

wp_ss_20151002_0001

and the image capture screen is there too;

wp_ss_20151002_0002

and it seems to mostly function but it looks like I need to do some work either to adapt or tailor this UI and that’s going to be the next decision to make…