Azure Presentation

As promised, here is my presentation deck and demo code from last night's user group meeting. Thank you to everyone who was able to make it!

The other note I wanted to add was the link that I was unable to remember last night in reference to denormalized data in the cloud.CAP Theorem.

Azure Presentation - [Download]
Azure Demos - [Download]

Make Existing Projects Run in Azure

Disclaimer: This is not a tutorial on how to take an existing project and make it 'just work' in Azure. Depending on your existing project it may either be as easy as described below, or so painful that it's not worth it. The goal of this post is simply to show how to make projects compatible with the Azure development fabric.

So you've got an existing project and are experimenting with making it run on the Azure platform. Do you.

A) Create new Azure projects and meticulously copy your code over?

B) Throw your hands up in defeat and tell your boss it's too much work?

C) Add a few snippets of code to your existing projects and be a hero?

As it turns out, C is the correct answer! In the case of either a web application or a class library, you can easily turn them into web roles and worker roles, respectively. In order to do this, simply unload the project and add the appropriate XML to the project.

To make a web application project (including ASP.NET MVC) able to run as a web role, add the following.

  <PropertyGroup>
    <RoleType>Web</RoleType>
    <ServiceHostingSDKInstallDir Condition=" '$(ServiceHostingSDKInstallDir)' == '' ">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\ServiceHosting\v1.0@InstallPath)</ServiceHostingSDKInstallDir>
  </PropertyGroup>

To make a class library project able to run as a worker role add the following.

  <PropertyGroup>
    <RoleType>Worker</RoleType>
    <ServiceHostingSDKInstallDir Condition=" '$(ServiceHostingSDKInstallDir)' == '' ">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\ServiceHosting\v1.0@InstallPath)</ServiceHostingSDKInstallDir>
  </PropertyGroup>

Once you've made these changes and reloaded the project, you should be able to associate your cloud service project with an existing web or worker role!

Unload Project
Unload Project
Edit Project
Edit Project
Editing Project
Add XML
Reload Project
Reload Project
Associate Role
Associate Project

A Few More Tricks

Copy LocalAs I was working on this post I came across a few more tricks and undocumented nuances that cost me an unfortunate amount of time trying to figure out.

  • In order to run an ASP.NET MVC application under Azure, you'll need to copy the System.Web.Mvc assembly local. This can easily be accomplished from the properties pane.
  • In web applications, you can not work with the RoleManager within Application_Start (see the remarks after the jump).
  • While you can make any class library a worker role, the development fabric will crash & burn if you do not have exactly one class in that assembly the derives from RoleEntryPoint.

Microsoft .NET Services White Papers

In late October, Microsoft announced their entry into the cloud computing space with Azure. Since then I’ve been playing around with it, and I tend to think that the majority of the resources have been spent on the Microsoft side of things – the documentation and client tooling are practically non-existent.

One question I continue to hear is, ‘What exactly is Azure?’. This is difficult to answer since it is actually many different components, each of which require their own description. To help shed some light on these services, Microsoft has released four white papers about the services under the ‘.NET Services’ umbrella. These are very well put together, and I think will help clarify many of the ‘what is it?’ questions.

Download the white papers here.

Windows 7 Beta - First Impressions

This weekend I wiped my system, and installed the freshly released beta of Windows 7 x64!

Why?

Why not? :) In hindsight, it may have been a bit irrational given that prior to today this system has been the most solid, stable, and enjoyable system I’ve ever worked with. I had been running Vista Ultimate x64, my very first daily-use Vista install, on fairly decent hardware for well over a year. It’s actually been so long since I’ve reinstalled the OS on my daily-use PC I completely spaced deauthorizing iTunes!

So what prompted the reinstall? After acquiring a copy of the PDC build, I installed it in VirtualBox, and the performance was unbelievable! Having experienced Vista in both the virtual and physical worlds, I’ve always felt like it depends on the Aero UI to feel snappy…it just didn’t feel quite as fast when virtualized or not using Aero. Yet this build of Windows 7 in its pre-beta state ran fast virtualized!

How’d It Go?

For the most part the experience has been pretty good. The install seemed to take an unusually long time compared to Vista…almost felt like the hardware wasn’t detected properly and hence not running at its best. This seems a bit strange since I’m running year old, fairly generic hardware. Unfortunately once I got to installing drivers, I found that the Intel chipset driver installation utility wouldn’t run due to ‘an incompatible OS’…I had to extract the zip file and manually install the drivers. Hopefully with the beta of Windows 7 publicly available Intel will update their driver package. The other hardware-related comment is that NVidia has Windows 7-specific drivers available through Windows Update.

Stability and performance have been nearly what I expected. Memory usage seems lower, and boot time seems faster. That being said, it hasn’t been a completely smooth experience.

  • When the system went to sleep for the first time it didn’t want to wake back up.
  • Connecting to Windows 7 via remote desktop is really, really slow and choppy, even on a fast LAN.

Software

For the most part the applications I use regularly installed and run fine. This includes Firefox 3, Foxit Reader 3, 7-Zip, BlackBerry Desktop, Launchy, Notepad++, Quicken 2009, TweetDeck, and the Windows Live applications. Both Silverlight and Flash run without any issues. For ISO mounting Virtual Clone Drive installed and works fine, and for antivirus I installed the free version of Avast! antivirus. All of my programming tools installed and run just fine – Visual Studio 2008, SQL Server Express, Tortoise SVN, ReSharper, & Visual SVN.

  • iTunes: This was by far the most frustrating part of this whole experience. The installer would continually hang after installing everything else included (QuickTime, Bonjour, etc.) but before iTunes. I finally got it to work by extracting the contents of the downloaded setup file, which contains the installation packages for the individual applications, and using the iTunes installer from there.
  • Google Chrome: Installed fine, but wouldn’t load any web pages. A simple Google search via Firefox brought me to a working solution. Turns out its an issue specific to the x64 version of Windows 7.
  • Skype: The latest beta of Skype 4 installs and runs fine…until you try to shut it down. If you log off, restart, or shut down with Skype running, it will crash, and sometimes Windows will prompt you that it can’t restart until Skype exits. Even if you close Skype by itself it occasionally crashes.

The New Taskbar

One of the most visible changes to Windows 7 is the new taskbar. For an excellent look at the new taskbar, as well as some of its issues, I recommend taking a look at Paul Thurrott’s Simple vs. Easy article. While there are definitely some strange usability issues with the new taskbar, I think Microsoft is very, very close to something very slick. I agree with Paul that in the default mode of ‘always combine taskbar buttons’ it isn’t entirely clear what is running, and that the ‘combine when full’ is more ideal. But that still doesn’t address the launching of new instances, which leads to the jump lists. I had found the jump list on my own via the right-click, but the click, hold, & drag up technique almost feels better.

One feature that Paul didn’t address in this context is what happens when you hold over one of the running applications. After a second or two, you get a little mini-view of the window…same as Vista. But if you hold over the mini-view, all the windows on your desktop become transparent except for the one you are hovering over!

Taskbar Hover

This, I believe, is the connection that has yet to be made…and Microsoft is so close! Paul points out that the taskbar was originally conceived address the problem of users ‘loosing’ open windows on the desktop – I problem that I often have as a developer who often times has many, many windows open at a time. In Vista, in addition to the taskbar and mini-views, you could also use the alt-tab, which shows only the icons and part of the window title, or the new win-tab, flip-3D eye candy, that does show the whole window, but at an angle. None of these things, however, work nearly as well as the hiding of all windows except one technique!

Think about it; they’ve got the new taskbar, and they’ve got this new hover behavior…how easy would it be to reduce the steps between mousing over the taskbar and simply hiding everything but what you are hovering over! Don’t flip it at an angle for the sake of eye candy…just show it, as is, by hiding everything else!

Final Thoughts

Overall I think this was a good thing. It gives me a chance to play with the latest and greatest, and it only cost me one authorized iTunes computer! Vista introduced the consumer to 64-bit computing, and over the last few years there have been many positive steps towards making hardware and software more compatible. Yet despite the state of Windows 7, most of the issues I encountered have been related to being an x64 OS.

That being said, I’m really excited for Windows 7. It is pretty much what Vista, an OS I very much enjoy using, that has been polished & refined. It’s already excellent performance is most certainly going to improve, applications and drivers will be updated (Intel and Apple, I’m looking at you!), and hopefully we’ll see some improvements to the taskbar, too.

Entertaining ASP.NET MVC Slides

Last month I presented ASP.NET MVC at the Billings .NET Users Group. While the presentation went pretty well, I am by no means a master of PowerPoint.

Ben Scheirman, on the other hand, is apparently quite good at PowerPoint. He presented the same topic at the Houston .NET Users Group last night, and his slide deck is as entertaining as it is informative. Follow the link to his post, and be sure to download the slides at the bottom of the post!

ASP.NET MVC Presentation

Here's my presentation on ASP.NET MVC from last night's user group meeting!

One of the neatest things I was able to show the group was Microsoft's Oxite project. From the site...

This is a simple blog engine written using ASP.NET MVC, and is designed with two main goals:
  1. To provide a sample of 'core blog functionality' in a reusable fashion. Blogs are simple and well understood by many developers, but the set of basic functions that a blog needs to implement (trackbacks, rss, comments, etc.) are fairly complex. Hopefully this code helps.
  2. To provide a real-world sample written using ASP.NET MVC.

We aren't a sample-building team (more on what we are in a bit). We couldn't sit down and build this code base just to give out to folks, so this code is also the foundation of a real project of ours, MIX Online. We also created this project to be the base of our own personal blogs as well so you'll probably see our blogs on the list of sites running Oxite soon.

This is a very cool example of MVC, and it's even been battle tested already running the MIX website!

Attachment: ASP.NET MVC.pptx

I’m Presenting ASP.NET MVC at the Billings .NET User Group Tomorrow!

Tomorrow, December 9th, I'll be presenting ASP.NET MVC for the Billings .NET User Group! If you're in the area I highly recommend joining us to learn about one of the hottest new technologies coming out of Redmond. There will be door prizes from O'Reilly Media and Microsoft!

Where: Behind the MSU-B Bookstore at 112 N. Broadway. The parking garages at 2912 3rd Ave. and 210 N. 27th close at 6:30 PM, so parking at either of these is free if you leave after 6:30 PM.
When: 5:30 PM

Ctrl-Alt-Del via Remote Desktop

How many times have you been connected to a remote computer via RDP, hit Ctrl-Alt-Del, just to be greeted by the Windows Security popup on your local computer. Unless you are using an RDP client that supports sending the Ctrl-Alt-Del to the remote computer, you're out of luck...or are you?

As it turns out, it couldn't be simpler - to send a Ctrl-Alt-Del to the remote computer, just hit Ctrl-Alt-End! D'oh!

Linus Torvalds On Git

Git is the hot new SCM on the block. Unfortunately, its support for windows is lacking at best. While digging around, I came across a tech talk at Google by none other than Linus Torvalds himself. As the brain child of git, he's got some interesting insights on the system. At the very least, it's intriguing to hear him speak.

Check it out here!

Graffiti CMS 1.1 Upgrade Successful!

Last week Telligent released the first big update to Graffiti CMS, and over the weekend I spent some time upgrading the site. To help others, here's some thoughts on the upgrade...

  • The instructions say to just copy the new files over the existing ones. One thing to remember to do first is to delete all of the existing content from the upgrade files. This could be fixed one of 2 ways - provide an upgrade download that contains no content and is specifically tailored to upgraders, or take advantage of IIS7 and do away with the need to have folders and pages for the content altogether! I would love to see the later.
  • Upgrading VistaDB is a bit strange. You have to 'migrate' the existing database to a whole new file - there's no in-place upgrade! The migration tool is pretty cool - I also took advantage of moving from SQL Server to VistaDB on this upgrade - but it seems like it could do so much more! How slick would it be to just point a tool at your database and have it upgrade? No more messing with SQL scripts!
  • Once I upgraded, I experienced a strange issue where I kept getting logged out. Not sure if this was due to high load on my hosting provider's server, or a result of changing to VistaDB, but it seemed like the process was continuously getting recycled every few clicks. I added a machine key to the web.config file and the issue went away - at least on the surface. There were no errors in the Graffiti event logs.

Overall, it wasn't that bad. I'd really like to see a handler for IIS7 so that the content folders and pages aren't necessary. Also, the configuration overrides from Community Server would be nice so I don't have to diff the old and new web.config files on each upgrade.

Congratulations on the release, Telligent!