« September 2012 | Main | January 2013 »

November 2012

November 06, 2012

Windows Phone 8 Development on Mac - All the Gotchas

After failing with my attempts to kickstart my Windows 8 development I decided to give Windows Phone 8 a try. Creating Windows 8 Developer account was straight forward compared to the Windows 8 experience however setting up the development environment on my Mac turned out to be painful. I will save you all the steps, which involved reinstalling Mountain Lion, setting up Bootcamp partition, installing Parallels etc. and resulted in few dosens screenshots with errors and exceptions in Visual Studio. Let's get straight to the point.

Is your machine ready for Windows Phone 8 development?

First of all, if you want to do Windows Phone 8 development (the same is true for Windows 8 development), you need a Windows 8 machine. In all fairness this is no different than iOS development... however there are the gotchas below :)

One of the most important things that you need when you do device development is the Emulator. If you don't want to spend all your money buying every possible Windows Phone the Emulator will be your solution for testing. Now, the problem with Windows 8 Phone development is that the Emulator uses the Hypervisor build into Windows 8. However in order to run Windows 8 Hypervisor your development machine (actually the CPU in your machine) needs to support SLAT. If you need more details you can go check Wikipedia's article about SLAT but briefly it is a new virtualization technology available in the modern CPUs.

Here are the official requirements for Windows Phone 8 SDK posted by Microsoft.

If you are like me and you bought your Mac awhile ago it may not be equipped with a "modern" CPU. Here are the steps you can use to check whether you will be able to run Windows Phone 8 Emulator on your Mac:

  1. Install Windows on your Mac
    If you have Windows already running on it it is fine. Doesn't need to be Windows 8, Windows 7 will work just fine. You can use Parallels or Bootcamp or whatever else you want. The sole purpose of this step is to have a way to run the program from Step #2.
  2. Download Coreinfo
    Coreinfo is a small program written by Mark Russinovich that checks low level hardware components.
  3. Run Coreinfo and check the output
    Here is the interesting part. If you have older Intel based Mac (or Macbook Pro like me) your machine may be equipped with Core 2 Duo processor that doesn't support SLAT. General rule is that Intel i-processors support SLAT while everything before that doesn't. Wikipedia has a good list of all Mac models and their CPUs.

For me here is how the output from Coreinfo looked:

CoreInfo

I have Core2 Duo P8600 and although it supports hardware virtualization I wasn't able to run Windows Phone 8 Emulator (as well as the Hyper-V in Windows 8). Interesting though Windows 8 Simulator runs fine although I thought is is based on the Hyper-V too. The best I managed to achieve was the following:

Win8Phone Designer Issue

Interestingly before upgrading from Lion to Mountain Lion I was able to at least see the designer working. Now this is gone though.

Should you use Parallels or Bootcamp?

If your Mac passed the CPU test the answer on this question is quite simple - you must use Bootcamp (or at least for now).The reason is that Microsoft Hyper-V doesn't run in virtualized environment hence your only option is to have Windows 8 installed on a separate partition using Bootcamp.

My personal opinion is that the approach Microsoft took (again) will prevent some of the potential developers to start development for Windows Phone 8 (and Windows 8) as you can see from the following articles and blog posts:
Developers praise Windows Phone 8 SDK, but virtualization and upgrades rankle
Windows Phone 8 SDK what a Big Time Flop
http://forum.parallels.com/printthread.php?t=264863
Windows Phone 8 Emulator on MacBook Pro – No SLAT

There are two articles that I found explaining how you can use VMWare Fusion to run Windows 8 on your Mac. I doubt it will be successful if your machine doesn't have SLAT support but maybe it is worth looking into them:

http://blog.brightpointuk.co.uk/running-windows-phone-8-emulator-mac-os
http://www.developer.nokia.com/Community/Discussion/showthread.php?238276-Windows-Phone-8-development-on-Mac-and-VMWare-also-using-the-Phone-Emulator

Good luck with your Windows (Phone) 8 development :)

November 01, 2012

I was so close to like Windows 8... so close!

Everything was great (kind of)! Build conference started lame - with a T-shirt and a shopping tote but SteveB fixed the things in the next hour by giving every one of us a Surface, Lumia 920 and 100GB Skydrive. In the last two days Microsoft made pretty good job to excite me about Windows 8 and Windows Phone 8, and after listening to Josh (Twist)'s talk about Azure Mobile Services today I decided to give it a try. Yes, I decided to develop my first application for Windows 8 (and maybe Windows Phone 8).

I went to the Microsoft Company Store to buy a copy of Windows 8 and Visual Studio 2012 with the vaucher that every Build 2012 attendee was given. Windows 8 was on the shelves but there was no sign of Visual Studio 2012 - not in the physical nor in the e-store. Nevertheless, using my MSDN account I spent 1/2 h downloading and another hour installing and I was able to get Windows 8 and VS2012 running in Parallels on my Mac. Impressive! Windows 8 was running much faster than Windows 7 and was not killing my machine. So far so good!

The first thing I did was to go to Windows Store Apps Dev Center and to sign-up for developer account (forgot to mention that SteveB also lowered the sign-up fee from $99 to $8 for the 8 days following the Build start). And here is when my enthusiasm vanished in just a minute.

Clicking on Get your developer account now send me to the following screen:

Error "We don't recognize the computer you're using"

First, I had no idea what content I am supposed to see but at least it was clear that I should do this from a machine that has the name LAJOLLA. I used to have a Windows machine that was called with that name but now my Mac is called LAJOLLA so I decided to give it a try. Hehe, silly! I must be kidding! Of course it didn't work! My assumption was that the machine must be a Windows one.

OK, no problem! I can easily rename the newly installed Windows 8 VM to LAJOLLA and give it a try. Well... Not really! Although I renamed the machine to LAJOLLA when I login to the page above I still see the same error. Must be something else!

My only option is to choose "Not using this computer anymore! Update your info." So I clicked on that and was asked whether I want to delete LAJOLLA. Hell, yeah! I want to create my Developer Account as fast as possible! But... SURPRISE! The info will be deleted in 30 days. For security reasons! Ugh, why? I am not sure I understood but whatever, I can go and add my brand new Surface and my newly installed Win8 VM as trusted PCs and I should be set to go. Nope! Those will be added ... guess when... in 30 days.

OK, let's go back and undelete the LAJOLLA PC and see what can we do to get my developer account set up. Because I WANT MY WINDOWS 8 DEVELOPER ACCOUNT to develop my first Windows 8 application. 

Although I did the deletion from the same browser session when I clicked on Cancel the deletion I got the following:

Now I am hosed with no trusted PC and no way to create Windows 8 Developer account for (at least) the next 30 days.

It is not about the $91 that I will save. It is about the 1h frustration and anger against the PM who invented this feature. I am wondering - what is the point of the 30 days wait time? Can't you just send me an email, or SMS on the phone, or ask me the security question? What will happen in 30 days more than in a day? Except that you may lose one more customer. 

Update: I just chatted with one of the Windows 8 people present at the Build conference. The suggestion I got was to create new Microsoft Account (or LiveID or Passport or whatever the name of it is) that I can use as my development account. He mentioned that they had similar issues because the MS Account team does not allow more than 5 machines connected to it (yes, ONLY FIVE!) and they use this internally to overcome the limitation.

Update #2: One thing that I forgot to mention is that although I renamed my newly installed Win8 to LAJOLLA when I access the Windows Account UI I still see the old name of the machine. Hence I thought that if I create new Windows 8 VM and name it LAJOLLA it may work (yeah, I really thought that this feature is not only lame but also badly implemented). However, after doing the above I ended up with the following:

Screen Shot 2012-11-01 at 9.02.25 PM

Well, this proves that it won't be easy to cheat the feature but as a user... I really don't get it! I am acessing the site from a machine with name LAJOLLA - why can't I change the security info? And what the heck does it mean that LAJOLLA will be deleted on 11/30/12 and added on 11/30/12?

Update #3: Here is also transcript of the chat I had with the Windows Store app development support representative:

Please wait for an agent to respond. You are currently '1' in the queue.

Privacy Statement

You are now chatting with 'Steven'.

Toddy: hi

Steven: Hello Toddy, my name is Steven. How can I help you?

Toddy: I am unable to create Windows 8 Developer Account

Toddy: there are some issues with my Windows Account I don't have anymore access to my trusted PC and I am unable to add any other PC as trusted for the next 30 days

Steven: Have you already completed the developer registration or is this preventing you from being able to actually complete the registration?

Toddy: This is preventing me from completing the registration

Toddy: It comes out immediately when I click the registration link

Steven: Unfortunately the 30 day waiting period cannot be bypassed. You may want to create a different Microsoft account and go through the registration with the new account. Unfortunately you won't be able to link your Windows Phone developer registration because the publisher name will be locked to your Microsoft account that is already registered as a Windows Phone developer account.

Toddy: Why is this waiting period required?

Steven: This is to protect the owner of the account if the account access has been compromised. The 30 day period is the time provided for the user to realize that they no longer has access to the account and to report the problem.

Steven: In a case where the account has not been compromised, the user must wait the 30 days, as this process cannot be bypassed or expedited.

Toddy: Can't this be done via email confirmation or phone SMS or something more advanced than 1 month waiting period? I do own the account and I can change everything like password etc.

Steven: You must already have a different method that has already been confirmed on the website below:

Steven: https://account.live.com/Proofs/Manage

Steven: If you do have a method listed there that had previously been approved, you can use that method to confirm your account.

Toddy: All other methods will be added also in a month

Steven: Unfortunately if the methods hadn't previously been added, you won't be able to verify your account through this authentication process until after the 30 day reset period.

Toddy: So! What you are saying is that there is no way for me to become Windows 8 Developer today correct?

Steven: Unless you were to use a different Microsoft account to go through the registration. This will require you to use a different publisher name than your Windows Phone developer account. If you have a business account, the publisher name must match your business name, so you would need to wait for the 30 day reset period to expire.

Toddy: Well, what can I say not very welcoming for new Windows 8 developers.

Toddy: Thank you for your time

Steven: You're welcome, sorry I could not do more to get you into the registration today.

Steven: Have a nice day.

Chat session has been terminated by the agent.