How to Develop Metro Apps on Windows 8 Server
Now everybody are excited to develop Metro Apps for Windows 8. And we have Windows 8 Developer preview with development tools preinstalled so every developer can easily start using it. On the other hand, Windows 8 Server has a lot of new features, and that means I have to run both platforms to study all the new things. It's not very comfortable to reboot every time I need a different platform, or to use a virtual machine which is usually quite slow. So I thought that since Windows 8 Server has Metro UI as well, why not just to install everything on Windows 8 Server and develop Metro and Web apps on a single platform? So I have installed Windows 8 Server Developer Preview on a bootable vhd drive. There are a lot of examples how to install Windows on a vhd drive, if you need instructions you could use the guide from Scott Hanselman. The installation process completed succesfully, and I started to set up the environment. Here is a small list of things that could hurt working with the Windows 8 Server platform. First, if you have downloaded some installation package, you have to unblock it fist:
Then, if you want text console to support non-english fonts, you have to set it up in regional settings. This option will require a reboot:
And the last thing is that if you plan to use Internet Explorer, it will be almost impossible to use without turning off IE Enhanced Security Configuration (the other option is to use Metro Internet Explorer, which is not very comfortable either). This option is inside Server Manager console:
Then I needed to run Windows Update to get the latest updates before I start to install everything else. On Microsoft server platforms Wi-Fi is not installed by default, you have to turn it on manually. It is located in Features step of Add Roles and Features wizard in Server Manager console:
Choose Role-based or Feature-based Installation on the Installation Type step, then select local machine on the Server Selection step. Skip Server Roles step, and under Features you will have Wireless LAN Service checkbox:
However I still was not able to select any wireless network. After spending a lot of time trying to fix my wireless network card drivers I decided to collect as much diagnostic information as possible, and started text console to use netsh command. I was very surprised to see that "netsh wlan show all" command printed out full wireless network list in my location! So my network card worked perfectly, and seems that there is no GUI support yet in this Windows build. So you can manually connect to wireless network using netsh command which is quite complicated, or there is a way to create a manual wireless network connection from Network and Sharing Center where you select Set up a new connection or network link. Then you choose Manually connect to a wireless network:
Then press next, fill out the parameters of your wireless network, which can be found in "netsh wlan show all" command output, and the important thing is to set Start this connection automatically checkbox.
After a few seconds I got my wireless internet, and started the update process. Fast way to get to Windows Update is to press Win+R, type wuapp and press Enter. The alternative is to get to Start Screen, run Control Panel, Select More Settings, System and Security, and finally, Windows Update. Now, use Check for Updates link from the left menu. Then I started to install IIS and ASP.NET. The easy way is to select Application Server and Web Server roles in Server Manager. But in my case, installation process completed with some sort of error. So I decided to use a minimum feature set. To install it, I did the same thing as in case with Wireless LAN Service, but in Server Roles step I set the following checkboxes:
Then, here is the Features step:
Now I was able to complete installation successfully. The next step is to install Visual Studio 2011 Ultimate Developer Preview. The installation process is very common and I got not a single problem installing in on Windows 8 Server. I also use JetBrains ReSharper which is in my opinion a must have for any .NET developer. Finally I created a "Hello, Metro World!" application, but when I tried to build it, I got this:
The problem is that libraries necessary to develop metro apps are provided only with Windows 8 Developer Preview image with Visual Studio 2011 Express preinstalled. So, there is a way to copy those files from there to Windows 8 Server Machine. Those files are located in "C:\Program Files (x86)\Windows Kits" folder, so I copied its content to my Windows 8 Server machine. Now, may application was successfully compiled and built! Unfortunately, when I tried to run this application, I got another error:
And I couldn't handle this yet. There are similar issues described on the Internet, but the most common solution is to adjust screen resolution, or to update video card drivers, which didn't help in my case. But I hope that on another machine it is possible to run Metro Apps on Windows 8 Server in that way. So I'm very interested in any feedback concerning this issue. Hope this could help someone :)















