Archives For thor

I’m pleased to announce that version 1.1 of Thor has been released. Here’s a summary of what’s new in this release:

  • Specify whether or not to display the subject of appointments on a calendar
  • Specify whether or not to use a booking agent on a calendar by calendar basis
  • Specify whether or not a calendar requires authentication to view and/or book appointments
  • Specify whether or not to display a given timeframe for a calendar
  • Highlight the current time in a calendar
  • Only passwords are encrypted when persisted to storage
  • The logo for the website was changed from a .png to a .jpg to accommodate Windows Mobile
  • The provider assembly dropdown only displays assemblies that contains type that implement ICalendarProvider
  • The provider type dropdown only displays types that implement ICalendarProvider

You can dowload all the goodness here.

I’m pleased to announce that version 1.0 of Thor was released on February 15th, 2010. The release includes the following downloads:

  • thor.deploy
    • Contains the necessary deployment package and service configuration file required for deploying Thor to Windows Azure.
  • thor.exchange.interop.exchange2007
    • Contains the assemblies required for enabling Thor to communicate with Microsoft Exchange Server 2007 via the Exchange Web Services Managed API.
  • thor.exchange.interop.exchange2010
    • Contains the assemblies required for enabling Thor to communicate with Microsoft Exchange Server 2010 via the Exchange Web Services Managed API.
  • thor.exchange.webservices
    • Contains the assemblies required for enabling Thor to communicate with Microsoft Exchange Server via Exchange’s native web services.
  • thor.source
    • Contains the source code (Change Set 43071) for version 1.0 of Thor.

You can download the bits here.

Check out the screencast below (brought to you by Silverlight and the Simple Silverlight Media Player) on how to deploy, configure and run Thor in Azure:

Install Microsoft Silverlight

I’ve also stubbed out some documentation here. There’s no content, yet, but I promise it will be coming over the next couple of weeks.

In my previous post I talked about some of the pain points I went through with Windows Azure and setting “Copy Local” appropriately on referenced assemblies. I thought I’d do a quick post to let you know which assemblies, other than my own, I ended up marking as “Copy Local”. As you’re aware Project Thor uses technologies such as Azure storage and diagnostics, ASP.NET MVC, and WCF RIA Services. If you’re using these technologies you’ll need to make the following assemblies are flagged as “Copy Local”:

Azure Storage and Diagnostics
Microsoft.Windows.Azure.Diagnostics
Microsoft.Windows.Azure.StorageClient
Microsoft.Windows.Azure.CloudDrive (new in the February release)

ASP.NET MVC
System.Web.Mvc
System.Web.Routing

WCF RIA Services
System.ComponentModel.DataAnnotations (for version 3.6.0.0 only)
System.Web.DomainServices
System.Web.Ria

Hope this helps.

So, I finally got Project Thor to a state where I felt comfortable deploying it to the Azure staging environment. After packaging it up, uploading it to the portal, pressing run, I waited with baited breath as my web role and worker role fired up. And I waited, and I waited, and I waited. Both roles went from Initializing to Busy to Stopping to Stopped. Of course, they work on my machine without problem. FAIL!

I have a bunch of logging in place, but the roles weren’t even getting to the point where they could log messages. After doing some digging on the Azure forums I came across this post. The underlying idea is that my apps were missing referenced assemblies. I saw this as a pretty good possibility as my apps are loosely coupled and I’m actually dropping assemblies into various directories as part of a post build process. However, my assumption was that the CSPack command line utility was simply packaging up the web and worker role directories for deployment. I wanted to verify my assumption was incorrect before proceeding, but since the package created by CSPack is encrypted there’s no way for me to verify the contents. Or is there?

Enter Jim Nakashima. Jim has a great poston how you can force CSPack to create unencrypted packages. After following the steps in the post and creating the unencrypted package, I dug into it to examine the contents. Sure enough, the assemblies I was dropping into my web and worker role directories weren’t getting packaged. After reading this post by JimI understood why. If I want to include the files in the package they need to be associated with the projects. This is kind of a bummer as I wanted to maintain the loose coupling, but I was willing to sacrifice it for the time being. I added the necessary references to my worker and web roles projects, packaged, uploaded, pressed run, and waited, and waited, and waited. Same thing as before. WTF?!

This post mentions to make sure you have “Copy Local” set to true for your assemblies. OK. Fine. No problem. I went through the web and worker role projects and set all references to “Copy Local” = true, packaged, uploaded, pressed run, and waited, and waited, and waited. OK, progress. The worker role started up, but the web role continued to fail.

I’m not one to typically post a problem on a forum as I like to go through the pain of solving them myself (helps me not to forget). However, at this point I was at my wit’s end. I posted the problem to the Azure forums, making sure to give Microsoft permission to open up my VM for diagnostic purposes.

After a couple of back and fourths, the problem became clear. I had marked all assemblies in my web and worker roles with “Copy Local” = true. However, I’m running a 32 bit dev machine (I know, I know I need to upgrade, but this laptop rocks, but that’s another post), and the cloud runs 64 bit. As a result, the 32 bit assemblies that were included in my package were failing to load as they weren’t 64 bit. Makes perfect sense! OK, so which assemblies are loaded in the cloud and which do I need to set to “Copy Local” = true? The answer lies here, but I’ll summarize it for you:

The cloud has a default installation of .NET 3.5 SP1, plus the Microsoft.Windows.Azure.ServiceRuntime.dll. This means you can refer to C:\Windows\Microsoft.NET\Framework64 on your own machine. All the assemblies available in v2.0.50727, v3.0, and v3.5 should be available on the cloud machines.

Many thanks to Yin-Lun Luo and Toddy Mladenov for the help.

Given the several valuable lessons I learned, I would once again say that Project Thor is living up to its mission.

In my last post I described an issue I was encountering with ASP.NET MVC and WCF RIA Services while writing code for Project Thor. The gist of it is that routing was intercepting the calls made to my WCF RIA Services by my Silverlight application and resulting in 404 errors. A quick change to the RegisterRoutes method and voila it worked! Or so I thought…

Since I thought my problem was solved I went on to working on other parts of the ASP.NET MVC side of Project Thor. However, one day, like yesterday, I was running the app and wanted to adjust an admin setting on the Silverlight side, so I typed in the url to the Silverlight page, and I got another 404. What?! That wasn’t supposed to happen. Grrr!

I started going down some pretty nasty rabbit holes on this one. I knew it had something to do with routing, but being new to ASP.NET MVC I wasn’t sure what exactly it could be. At one point I had myself convinced it had do something with local Azure development fabric and integrated pipeline mode on IIS 7.0 running on Windows 7. I wasn’t getting anywhere. I’m not the type of guy that posts my problems and asks for help. I like working through these things on my own (yes, I am a glutton for punishment). However, I needed to get moving so I put the question on Stack Overflow. Within minutes, like 1 minute, I had two responses. The first response was on twitter from John Sheehan. The other response was on Stack Overflow and from none other than Phil Haack. Both responses weren’t a direct answer to my question, but they both pointed me to the ASP.NET Routing Debugger. As the page says:

“This utility displays the route data pulled from the request of the current request in the address bar. So you can type in various URLs in the address bar to see which route matches. At the bottom, it shows a list of all defined routes in your application. This allows you to see which of your routes would match the current URL.”

I downloaded the utility and fired the app up. Here’s what I got for the default page:

Figure 1

Good. Exactly what I expected.

I then tried to navigate to the configuration page that contains the Silverlight application:

routetestb

Bam! There’s the error! I shouldn’t be getting a match on the first route, the route I want MVC to ignore, the route I told MVC to ignore in my last post. D’oh! If you remember, my RegisterRoutes method looked something like this:

public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{Services}/{*pathInfo}");
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Configuration",
                "Configuration",
                new { controller = "Configuration", action = "Index" }
            );

            routes.MapRoute(
                "Calendars",
                "Calendars/{id}",
                new { controller = "Calendar", action = "Index", id = "" }
            );

            routes.MapRoute(
                "Default",
                "{controller}/{action}/{id}",
                new { controller = "Account", action = "Index", id = "" }
            );
        }

See those curly braces around Services in the first line of the method. Those curly braces that are the MVC convention for replacement. Yeah, um, those shouldn’t be there. I’m not replacing anything. I want to ignore any calls to the actual Services directory. So the updated line looks like this:

routes.IgnoreRoute("Services/{*pathInfo}");

Once I made this change here’s what the testing utility showed me.

routetestc

Perfect! When I then ran the app without the route debugging utility in place it worked as expected. I’m always amazed and at how so many seemingly complicated problems are solved with one line of code.

So, what’s the upshot of all this? Well, as I mentioned previously, the main goal of Project Thor is to help people, especially me, learn about other technologies they don’t get to work with on a day-in/day-out basis. Today I learned two things about ASP.NET MVC:

  1. Routing is incredibly simple, ONCE YOU UNDERSTAND IT!!!
  2. There is a great ASP.NET MVC community out there willing to offer assistance if you need. (Thanks again John Sheehan and Phil Haack!)

In my opinion Project Thor is, once again, accomplishing its goal. Now to finish version one!

MVC-ing WCF RIA Services

January 8, 2010

In my last post I wrote about how I’m going to spending some time focusing on UX. However, I will be spending some time on other endeavors as well. One of those endeavors is Project Thor. I don’t want to go into all the details of Thor as I’ll be posting more about the project as we get closer to our February 1st release date. However, I ran into an issue last night/this morning that I thought deserved an immediate post. One of the goals of Thor is to get developers exposed to technologies that they might not otherwise have a chance to tinker with. To that end we’re using things like Windows Azure, Microsoft Tag, Exchange Web Services, Powershell, Silverlight, WCF RIA Services, and ASP.NET MVC. We’re using Silverlight and WCF RIA Services to provide a configuration front-end to the app. ASP.NET MVC is being used to provide a mobile front-end that users will use to reserve conference rooms. I’ve been doing the Silverlight/WCF RIA Services and up until yesterday evening everything was working great. Data was flowing from the Silverlight app through the services to our Windows Azure storage mechanisms. Then, last night, one of the other developers told him he had checked in some changes to complete the MVC-ing of our Windows Azure Web Role and that his code (mobile web type stuff) was working. “Great!” was my initial thought. Then I pulled down the latest source code from CodePlex and realized that while his stuff was in fact working all of our Silverlight/WCF RIA Services was busted. WTF? Why would ASP.NET MVC code break our Silverlight/WCF RIA Services. Time to put on the debugger had and figure this sucker out.

The error I was receving was fairly non-descript but it basically told me the request resource (service) could not be found. The first thing I did was to take a look at what he had checked in, specifically in the web.config file. One of the more interesting entries I found was this one:

Now keep in mind I’m fairly new to ASP.NET MVC. I understand how it works at a high-level and I’ve built a couple of basic CRUD apps, but I haven’t really dived into the guts of it as I spend most of my time in Silverlight. Putting the web.config entry together with the error got me thinking that maybe this UrlRoutingModule thingy was intercepting the WCF RIA Service request coming from the Silverlight app transforming it into something that could no longer be mapped to the desired service. It took a while for me to put this together and Fiddler played a big role in helping me sort through this.

After doing a bunch of reading on MSDN to better understand both ASP.NET MVC and the UrlRoutingModule thingy I realized the key to solving this problem was the RouteCollection. I need to modify this to not route incoming requests for our WCF RIA Services. Doing this was pretty simple. The developer who MVC’d the app had checked a global.asax file. I found the following method in the class:

public static void RegisterRoutes(RouteCollection routes)
{
     routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
     routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Configuration", action = "Index", id = "" });
}

All I needed to do was add a route to ignore service calls. In my case, I keep all of the WCF RIA Services in a folder named Services, so I just wanted to ignore all calls to the Services folder. Here’s what I came up with:

public static void RegisterRoutes(RouteCollection routes)
{
     routes.IgnoreRoute("{Services}/{*pathInfo}");
     routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
     routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Configuration", action = "Index", id = "" });
}

F5 and voila! Problem solved! I know for a lot of you ASP.NET MVC veterans the answer to this problem was probably obvious. However as an ASP.NET MVC rookie I had to start digging into the guts of how ASP.NET MVC worked to solve this problem, which means I learned a whole lot about ASP.NET MVC, which is one of the main goals of Thor. So, in my mind at least, Thor is definitely on the right track.

 

Last night at the Twin Cities Cloud Computing User Group we officially kicked off Project Thor. We had some great discussions about the project is, why we’re doing it, and what we hope to accomplish. At the end of the meeting a total of 12 people volunteered to help deliver Project Thor.

However, we don’t want to limit participation in the project to just people who attended last night’s meeting. If you’re interested in working on this project contact me via one of the following methods:

When you contact me, let me know which area you’d be interested in working on (i.e. UI, middle tier, storage, etc.) This will help me allocate resources for the project. Last night we mentioned there are a several things you should do now to get ready to start working on the project. Here’s the list:

  1. Request an invitation code for a Windows Azure Account here: http://go.microsoft.com/fwlink/?LinkID=129453. Do it now, I’ll wait. There is a waiting list, so once you make the request, send me the email address you used to request the invite code. I may know of someone who can expedite the process for you.
  2. If you want to work with SQL Azure, you’ll need to request and invitation code for that as well. You can make the request here: https://connect.microsoft.com/Survey/NominationSurvey.aspx?SurveyID=5719&ProgramID=2089&SiteID=547.
  3. Sign up for an account on CodePlex.com. Once you have your CodePlex username, email it to me so I can add you to the project.
  4. Download the design document from the project’s website (http://thor.codeplex.com). Keep in mind, this is a first cut document, and will undoubtedly will be modified greatly in the coming days.

You’ll also need to get your development environment set up. Here’s what you’ll need:

  1. Windows 7, Windows Server 2008, or Windows Vista w/SP1
  2. IIS 7.0 (with ASP.NET, WCF HTTP Activation, and optionally CGI)
  3. Visual Studio 2008 SP1 or Visual Web Developer 2008 Express Edition with SP1
  4. SQL Server 2005 Express Edition (or above)
  5. If you’re going to be doing PowerShell development on Windows Vista you’ll need to download the PowerShell 1.0 Installation Package here: http://www.microsoft.com/downloads/details.aspx?familyid=C6EF4735-C7DE-46A2-997A-EA58FDFCBA63&displaylang=en

Here’s a list of resources that you may find useful during the development process:

We will be hosting a weekly status meeting via LiveMeeting. The idea is to open a LiveMeeting session up for a couple of hours one night a week where people can drop in and discuss what they’ve been working on and any issues they’ve run into. I’m working out the details now, but I’d like to have this meeting on Thursday evenings from 7-9. If there’s a better day of the week and/or timeslot let me know. We’ll use our first meeting next week to really dive into the guts of the various components. I’ll send out a meeting request later today/this weekend. Finally, if you know of anyone else who might be interested in working on this project feel free to invite them. The more people the better.

Project Thor Part 5: Prototype

November 10, 2009

In my last post in this series I did two things. First I showed you a prototype version of the mobile piece of project Thor. Second, I told that my next post would include architectural/design documents. Well, I changed my mind a bit. Before we can really discuss design, I wanted to be able to give you a way to play around with the UI components of Thor, so you can get a real hands on feel for what we’re trying to accomplish.

There are two UI components:

  1.  Admin. Users utilize this component to specify which calendars they want to expose via the website. Once a calendar is setup, backend processes (i.e. Azure Worker Roles) will query the Exchange for the calendar’s appointment data and update a cache that will then be utilized by the mobile component.
  2. Mobile. Users will be redirected to this component after they use their mobile devices to capture the tag associated with the calendar. Users will then be able to book an appointment on the calendar.

I used SketchFlow to create a prototype that will allow you to explore the two components using. There are a number of notes on each screen to explain intent. Take a look, play around, read the notes, and let me know what you think.

You can view the prototype here.

Next up, architecture/design docs, I promise! Stay tuned…

Project Thor Part 4: Demo!!

November 9, 2009

In the first three parts of this series I laid out the problem statement, assumptions, business requirements, and technical requirements. In this post I want to demo the functionality we’re trying to achieve. Check out the screencast below (brought to you by Silverlight and the Simple Silverlight Media Player.)

A few notes about the demo:

  1. The website shown in the demo is not currently hosted in Azure. The current prototype is, um, somewhat, how would you say, INSECURE. Thus, there is no way I would release it to a production environment. However, the code is running on my local Azure development fabric and was created the Azure tools for Visual Studio 2008 SP1.
  2. Thor is supposed to show schedules for conference rooms. In the demo I show my calendar from RBA. I didn’t want to expose unnecessary data regarding RBA’s Exchange setup.
  3. Part of the demo includes using a jailbroken iPhone. The jailbreak was done to allow VNC connections for the purpose of the screencast. Keep in mind the end product of Thor will not not require a jailbroken iPhone. Thor will work on an iPhone, an Android phone, an oh, yeah, a Windows Mobile Device :) .

Here’s the screenast:

 

Install Microsoft Silverlight

Alternatively, you can download the .wmv file for offline viewing here.

(P.S. – Sorry about the audio quality, still working on getting that  better mic).

(Note: Typically I’m not a fan of cross posting, but I wanted to post this information on my site as well in case people aren’t following the Twin Cities Cloud Computing User Group)

In Part 1 of this series I described the problem we’re trying to solve with Project Thor. In Part 2 I walked through the assumptions and business requirements. In this part I’m simply going to lay out the technincal requirements. So, without further ado, here you go:

Technical Requirements

  1. The Thor Service will be developed to run on the Windows Azure Fabric
  2. The Thor Services will be architected to support supplemental services to be added to the application as needed
  3. The Thor Services will be architected securely
  4. The Thor Services will be designed to be stateless
  5. The Thor Services will be designed to support different Exchange Providers
  6. The Thor Services will be designed to support both on premise as well as BPOS implementations of Exchange
  7. The Thor Services will include PowerShell scripts necessary to deploy and manage the Thor Services themselves

In the next part of this series I’ll actually demo (via Screencast) a prototype of Thor to give you an idea of what we’re going for.

Stay tuned…