So I always start these kind of rants by saying .NET is still awesome and I think Microsoft still has a chance to catch up to IOS on some level in the tablet industry yada yada yada. But today, I say “Microsoft I HATE you!”. Why you might ask, because one of my biggest pet peeves in writing code is knowing what your audience is and what type of information to provide during an exception or catastrophic failure.
If you are writing something for non tech savvy people, log the error (notice I still say LOG IT MICROSOFT) and show some happy kumbaya around the campfire type of message to the user. This way either it can be sent to the proper software company to be analyzed and patched accordingly or to the users IT department to fix. Either way, there is a reference to the issue.
Now, on the other hand, if you write a tool that’s primary purpose in life is to provide developers the ability to validate their application prior to placing it in their store, one would think kumbaya goes right out the window right? I can handle an exception that says something like
“There are duplicate files in AppManifest.xml. Remove one of the files and then try again”
Now, if you are wondering if I used that error message for a reason, you are correct and i will come back to it in a moment. This message is gibberish to the common user, but not for a developer (and if it is gibberish to a developer, they should be reading up more on phone development or at the very least be able to Google this and get an answer).
So what am I leading up to you might ask? Well, I am just wrapping up writing a Silverlight application I started a few weeks ago and was adding some Ad Controls since I was making it free. Everything worked fine in my tests, I did some sideload testing and everything looked great. I go to use the Windows App Cert Kit to verify the app won’t immediately fail and what do i get back immediately?
Failed to unpack ‘xap file’. The file does not appear to be a valid xap package.
I looked at it and said, “Huh!?”. I just ran it on a device for crying out load. Maybe I should coin COL for texting?:) Anyways, I digress. The point is, this should not have been so vague. I mean really? So I posted on SO. You can see the quick and dirty answer I provided there if you would like.
So What did I do?
Well, after a bit of searching and no one answering me on SO, I decided to upload it anyway and see what happened. Oddly enough, I actually got some errors worth the paper they were written on. Imagine that? Here is what i got back.
Those last 2 look familiar? The others were simple fixes and were not the cause of my current conundrum. It turned out after looking at these error messages, that instead of complaining about using invalid libraries on a Silverlight App like VS usually does, VS just added the Microsoft Advertising SDK .DLL files twice.
It turns out, that the SDK that comes with VS 2013 Update 2 is for Windows Phone 8.1 only and there is a separate SDK for Silverlight 8.1 here under Windows Phone 8.1 Silverlight Apps. After I installed that and added it to my references, the world was a whole sphere and no longer flat!
Happy coding folks! 🙂