AccessViolationException During VS2010 Debugging in VBox

If you’re using VirtualBox to host a development environment for Visual Studio 2010, this info may be helpful to you.  During debug sessions, you may receive the following exception:

Access Violation Exception in VS2010 guest in VirtualBox
Access Violation Exception in VS2010 guest in VirtualBox

I resolved this problem by disabling VBox’s Nested Paging option for memory.  You’ll need to shut-down the guest OS, open its settings in VBox, and turn off the Nested Paging option.

VirtualBox Guest Settings Dialog, System/Acceleration/Enable Nested Paging Turned Off
VirtualBox Guest Settings Dialog

For reference, my configuration is:

Base OS: Windows 7 x64

Virtualization Host: VirtualBox 3.2.8

Guest OS: Windows Server 2008 R2, Standard

Visual Studio 2010 10.0.30319.1 RTMRel

Lightswitch: Initial Thoughts & Recommendations

I tinkered with the first public beta of Microsoft’s new Lightswitch application development tool.  Here’s a few initial thoughts:

  1. Lightswitch makes it very easy to access data in pretty rich ways.  Business people who are not developers will be able to unlock corporate data in ways that would typically require a developer or significant knowledge of querying tools, etc.
  2. Lightswitch is easy, approachable, but there’s still some learning curve involved.  Layout Items such as Vertical Stack, Horizontal Stack, Text and Picture, and so on provide rich user interface capabilities, but how long will it take users to learn how to use them properly.
  3. Data access is very easy — maybe too easy.  Just point Lightswitch to an existing data store and go!
  4. Relationships to data are automatic or easy to assign.  The features around these relations are very good — Master-Detail screens are super easy.
  5. There’s no hard deployment requirement for Lightswitch apps.  Yes, it requires Silverlight, etc., but you don’t have to deliver it into an IIS farm, etc.
  6. OOPS!  Businesses must realize that all previous points add up to the potential for major train wrecks with data.  For example, data relationship features make it easy to create Master-Detail screens, but cascading deletes are just as easy.

Recommendations:

  1. Businesses should take great care to ensure that all Lightswitch application development runs against TEST data.  Far too many companies ignore or skip this Best Practice, but they may suffer seriously if they aren’t careful.
  2. Protect data at the database; not in the app.  Again, this is a Best Practice for software design, but I wouldn’t expect business people to be in tune with it.  DBA’s or data owners must protect production data and provide matching test databases (identical schema, data domains, security, etc.)
  3. Don’t prototype and expand.  People will be tempted to take a Lightswitch application’s generated code, turn it into a full-fledged Silverlight project and then build from there.  Don’t!  Is it possible? Probably, but it’s also possible to climb stairs to the top of the Empire State Building.  I suspect future versions of Lightswitch will reduce this gap (a la creating OCX’s with VB back in the day)

Lastly, I did run into several bugs — not unexpected in an early beta.  One example the product team may be interested in has to do with changing screen layout in non-debug mode (Ctrl-F5 from VS2010) results in

Error: The last change wasn’t successfully persisted. Please shut down the running application. Error: Change cannot be persisted because KittyHawk is not running under debug mode.

Who Cares About the Cloud? (Gartner Webinar)

I listened in to Gartner’s webinar today on Who Really Cares About the Cloud – An Industry Perspective. If you’re looking for a multi-industry analysis of cloud adoption, this webinar is a good place to start.  Check Gartner’s website for replay.

My key take-aways were:

  1. Companies’ major attraction to cloud computing is for cost reduction.  No big news here; reinforces what we knew.  Ability to implement solutions more quickly seemed to be a distant second attractor.
  2. Companies’ major hurdle is security.  Again, more reinforcement than news.  This meme continues to interest me because I believe cloud security (or lack thereof) is driven more by appropriate architecture and implementation, and less by whether the system is cloud-based or not.  Who owns the data seemed to be the second biggest hurdle.

Again, if this topic is interesting to you, I encourage you to check out Gartner’s site to replay the webinar.

Winners and Losers in Oracle’s Java Battle

I have a confession to make: I don’t use Java much.  There, I’ve said it.  You’ll have to take this post with whatever grain(s) of salt you determine.

I’m a software developer who works primarily in the Microsoft technology stack.  Many years of C#, .NET, etc. in my history, and now Azure is my main focus area.  However, I’m very interested in Android, so lately I’ve been tinkering with it and considering building an app for the marketplace.  Isn’t it interesting that a cell phone OS is the pull for me to get into Java, GAE, Eclipse and even Linux? But that’s probably better saved for another post.

Consider the case for Android developers: The up-front costs for Android development is almost exclusively hardware.  You need a development workstation and, eventually, Android devices for real-world testing.  Linux, Eclipse, Java and Android are all free.  Well, for now.

What happens if Oracle gets its way in the Java suit against Google?  Would Google continue giving Android away for free while paying Java royalties to Oracle?  These questions clear the fog a bit in terms of the suit’s potential impact.  And those impacts have already begun.  Many developers are now forced to take a wait-and-see approach to Java-based projects, including Android projects.

So it seems that Java-based or -oriented projects, big and small, are losers in this equation.  Who are the winners?  Will Oracle be a winner?  They may well see a revenue upswing, but it will drive many away from Java.  Will IBM continue it’s Java investments?  That leaves Microsoft.  Will Java developers migrate to .NET?

“May you live in interesting times.” – Chinese proverb

Who wins market share from #Oracle’s #Java suit on #Google?  #Microsoft? #IBM?

OnClosingOSS(Oracle, Java, Google)

What is the impact of Oracle suing Google over the latter’s use of Java in Android?  Is it just a little spittin’ match between two software giants?  Or will it have industry-wide implications?

Unfortunately, this case will have substantial, industry-wide implications.  If you’re not so sure you agree, I recommend you check out

The Rymer/Hammond post lays out Oracles options after acquiring Java.  I agree with them when they say that Oracle chose to “Supercharge Java as a money machine.”  The other option?  Reinvigorate Java as an OSS leader.

Although it’s impossible to predict what will occur in the Java development community, I do think it’s clear that Oracle’s suit against Google will drive many formerly Free OSS (FOSS) systems to For-Profit OSS which would be better named OSSINO – OSS In Name Only.

Enable Multiple Action Claims in AppFabric WRAP/SWT Sample

If you’re using the ASPNETSimpleService sample for investigating Azure’s August release of AppFabric (currently in AppFabric Labs), you might like to know a simple change to enable more action claims.

The sample provides instructions for creating the necessary ‘reverse’ value for the ‘action’ claim in an ACS Rule Group.  But what happens if you have more than one ‘action’ claim in the rule group (either by adding or by reusing an existing rule group)?  The sample breaks and renders WebException, (401) Unauthorized.  What gives?

The client app retrieves a SWT from AppFabric’s ACS and passes it to the web service.  The web service (implemented in the sample’s default.aspx) verifies that the SWT contains the ‘reverse’ value of the ‘action’ claim.  Unfortunately, the sample expects the SWT to look like:

“action=reverse&Audience=http://localhost:8000/Service/&ExpiresOn=1281474685&Issuer=https://<your-namespace>.accesscontrol.appfabriclabs.com/&HMACSHA256=muXlPgsuZkO9BHNAZqA97TZj4gz4NLKc0Ut58Y=”

This SWT will work fine.  Notice the claim “action=reverse” at the beginning.  If you aren’t aware (I wasn’t), multiple values of an claim are combined and separated by commas.  So, if you have another value ‘translate’ for the ‘action’ claim, the SWT will look like this:

“action=reverse,translate&Audience=http://localhost:8000/Service/&ExpiresOn=1281474685&Issuer=https://<your-namespace>.accesscontrol.appfabriclabs.com/&HMACSHA256=muXlPgsuZkO9BHNAZqA97TZj4gz4NLKc0Ut58Y=”

And that makes sense.  Why include multiple ‘action=<value>’ sections?  One simple change to the sample enables it to handle this situation.  Around line 90 of the sample’s default.aspx you’ll see

// check for the correct action claim value
if (!actionClaimValue.Equals(this.requiredClaimValue))
{
this.ReturnUnauthorized();
return;
}

This bit of code is requiring that the actionClaimValue (which comes from the SWT) EQUALS the expected value (requiredClaimValue which set to ‘reverse’).  In the second SWT above, the value of actionClaimValue will be “reverse,translate” which do not equal “reverse”

Simply changing Equals to use the Contains method fixes the sample.  Based on this situation, I don’t think using Equals is a good idea for your apps.  Contains is a reasonable alternative, but you may want to use a more rigorous practice.

CloudStorageAccount.Parse fails on trailing semicolon

Be careful not to let a sneaky little semicolon add itself to the end of your Azure connection string!  It’ll cause CloudStorageAccount.Parse to throw “Invalid Account String” exception.  For example

“AccountName=<account>;AccountKey=<key>;DefaultEndpointsProtocol=http”

works as expected, but

“AccountName=<account>;AccountKey=<key>;DefaultEndpointsProtocol=http;

causes the exception.  Spaces after the semicolon result in the exception, too.  The easiest fix is to use TrimEnd

azureConnStr = azureConnStr.TrimEnd(new char[] {‘;’});

I wish Microsoft would code Parse to handle this case more gracefully.  I guess it seems like just a little thing, but when you’re connecting to the cloud tracking down problems like this takes too long.

AppFabric goes Production on 4/9/10

Microsoft announced that the Windows Azure AppFabric will go live for production purposes on April 9th.

Pricing: Service Bus will now be charge $3.99 per “connection-month;” $1.99 per 100,000 Access Control transactions.