Sunday 24 May 2009

Back from Holidays in the Paradise that is Vanuatu

My wife, kids and I just arrived home from Vanuatu after 5 days off work. Greg at Oakton was kind enough to let me take some time in lieu of the long hours & weekends I've been working of late. We were originally going to head to Fiji or Thailand but decided to go to Vanuatu - which turned out to be a good decision considering some of the political turmoil in those countries. You can see all the photos are at the usual spot on my site -

Some of my fave things from the trip:
  1. The Mele Cascade Waterfalls were truly a vision of paradise on earth. As you continue along the stream to the turquoise swimming pools, there is beauty on every turn.

  2. My first visit to an active Volcano - Yasur Volcano on Tanna island. Unfortunately it had rained so couldn't see the lava very well. Despite this, we did see boulders being thrown a hundred metres into the air and heard the loud cracking & bubbling from the heart of the volcano. Not to mention, the ground we were working on was very hot and steaming as well. It made me appreciate the power of mother nature a little more.

  3. The water in the lagoon outside our front door was always warm so I could swim and kayak between the islands like I did before when staying on Beachcomber Island in Fiji on Schoolies (a while ago now :o) ).

  4. Captain Franz the pilot was an amazing guy and has flown 38 different types of aircraft and stopped in Vanuatu half way through his 2nd yacht trip around the world. Problem is that he needed no less than 2 pillows to see over the dash of our 6-seater Cessna as it was thrown around by the turbulence around Tanna Island.

  5. I've not been to a swim-up bar before. I'm not going to complain about the experience apart from the fact that heaving drinking and swimming probably isn't a great mix. The Mai Tais go down pretty easily when sitting in one of the 2 bars in the pool.

  6. The lagoon outside our doorstep was absolutely full of red, orange, white and blue starfish. I've never seen so many in one place. On account of their large numbers, at first I thought they must all be plastic!

  7. I always love to tease her about this one...a highlight was that my wife lost during a few late night visits to Jupiters Casino. It opened 2 months ago and the dealers are new and a bit questionable - but she decided to give it a go regardless. I always tell her that the house always wins... but she just doesn't listen :o)

Friday 8 May 2009

"Exception has been thrown by the target of an invocation." when creating a user in the ASP.NET Web Administration Tool

One of the requirements for an ASP.NET application we recently created at Oakton (for a certain NSW government department) was that deletes of lookups (including users) should be soft-deleted by using an "IsDeleted" flag.

To fulfill this requirement, we added an additional column to the automatically generated "aspnet_Users" table simply called "IsDeleted" so we could filter out these deleted users from lookup lists (e.g. dropdowns and autocomplete textboxes).

Edits worked fine after this change, but the creation of new users from the built-in ASP.NET Administration Tool was failing with the following exception:

Exception has been thrown by the target of an invocation. at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Web.Administration.WebAdminMembershipProvider.CallWebAdminMembershipProviderHelperMethodOutParams(String methodName, Object[] parameters, Type[] paramTypes) at System.Web.Administration.WebAdminMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) at System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

This error message wasn't particularly helpful, so I checked out SQL Profiler to get the real error message turns out that the IsDeleted column didn't have a default on it, so the insert of the record was failing on the call to the aspnet_Membership_CreateUser stored procedure.

The simple fix was to just add a default for the new column - otherwise custom columns you add to the generated membership tables will cause the provider to fail when creating new users. This will of course not just happen with the built in tool, but any page using the built in ASP.NET membership provider.