Tech.Ed… hey that’s me!

Well if you visit you’ll find a funny old picture of yours truly smack bang in the middle of the page! Clicking on my left nostril will take you off to the newly launched Tech.Ed 2006 Australia website, where once again you’ll come across my likeness, as well as those of some other people I know.
Yes, for the next 3 months I am officially ‘Tech.Ed’ having been convinced by Frank Arrigo to take part in the promotional activities this year. It’s farily surreal seeing your own face plastered across the front of a website like Microsoft’s but at the same time it’s pretty exciting too!
This year’s event looks set to be the best yet with a real focus on the attendees having fun and being made to feel a little special. The educational aspect is back with a vengence too with heavily discounted MCP exams being offered during the event once again.
My work is set to send 3 people again this year, which will attract a nice discount if we register before June 9, as well as getting cool personalised Tech.You t-shirts (no prizes for guessing what mine will say). I am currently checking out potential places to stay during the week and all in all it’s shaping up to be a fantastic week.
So get over there and register now!

Code Camp Oz 2006: Day two

It’s the second and final morning of Code Camp Oz 2006. Wagga Wagga is putting on beautiful fresh autumn weather for us today which is nice. Yesterday afternoon saw some really good sessions, especially Sharepoint 3 and a session on Software Factories and the Guidance Automation Toolkit by one of my favourite presenters, Readify’s Martin Granell. This is an area I’m really interested in and something I would love to put the effort into at my workplace so that we can quickly turnaround true enterprise-class applications using best-practises and some of what we’ve learnt too.
Today’s sessions I’m looking forward to include ATLAS, and intro. to TSQL. Having only developed on Oracle I have very little exposure to TSQL but it’s something worth knowing.
Last night after the sessions we enjoyed some of the offerings of the CSU’s on-campus winery and cheese factory. As a student I actually get 25% off when purchasing their produce so I might have to visit the cellar door sometime before I leave. After that was dinner at another local place which we bombarded with our endless geek-talk as the discussions swung from the nuances of bubble sorting a billion items to whether Word really is any good as a database platform.

Code Camp Oz 2006: The First Morning

First session was about Windows Workflow Foundation, which I really liked. Something I definately want to look more at over the coming 12 months, in particular possibly replacing some custom stuff we have in certain apps with a WF-based system.
Second session was an excellent informal discussion about starting and running user groups, something I am looking to do this year in Ballarat.

Arrived in Wagga Wagga for Code Camp Oz 2006

Well I have arrived safe and sound in Wagga Wagga for Code Camp Oz 2006. It’s quite a long drive from Ballarat to Wagga Wagga but I’m sure the journey here and back is worth it. I’m particularly looking forward to the sessions on Atlas and starting & running user groups. I’ll post a summary of my experiences during the event. Tonight I’m off to a local mexican joint to join in the pre-event drinks & dinner session. I had planned to post some photos during my stay but turns out I brought the wrong USB cable for my camera! So the crappy VGA resolution of my Smartphone camera will have to do.

“HTTP 401: Access Denied” error trying to call WSE web service

This one has been in the back of my mind for a few weeks as something I knew I had to fix. Starting looking at it again yesterday and after 3-4 hours of refactoring and config. changes I still couldn’t get it to work.
Of course, leave it over night, start afresh in the morning, do a new web search using terminology discovered in my sleep and an answer presented itself, and what’s more it was so bleeding obvious I had to kick myself!
I was getting an HTTP 401: Access Denied error trying to call a web-service on my local machine. I’m also using certificate encryption and message signing via WSE 2.0 so I thought it was something to do with that. The calling app was a WebForms test harness so I created a WinForms test harness just to make sure it wasn’t something to do with that. It wasn’t, same error whether calling from ASP.NET or WinForms.
In the end, turns out that web service calls are not made in the context of the user running the calling app. The request actually has no credentials associated with it, so if the web service resource on the web server, in this case the .asmx file, requires authentication you’ll get, surprise surprise, a 401 error. Duh!
So, two choices to fix. Either make the web service accept anonymous requests by changing the security config of the application’s virtual folder in IIS (and ASP.NET), or pass some credentials along with the web service call. The second one is easily achieved by setting the Credentials property of the web service proxy class to some valid credentials, this line sets it to the current user’s credentials:
    proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
(see this MSDN article for more details)
But in our scenario I’ve chosen to let the web service accept anonymous requests as it makes deployment a lot easier and doesn’t sacrifice any security because we are using message-level authentication, authorisation, encryption and signing via WSE to secure the transaction.
Looking back at it now I can’t believe we didn’t see it eariler, but hey that’s coding.

Code Camp Oz 2006

I will be going to Code Camp Oz again this year in about a month’s time. I really enjoyed last year’s event and hope that this year will be even better. I am staying in a much nicer hotel this year after the woeful experience of staying in a caravan park cabin last year, with no Internet access, no restaraunt and nobody around to hang with.
I will be driving up from Ballarat and can pass through Melbourne if there is anybody needing a free lift there and/or back. I could take upto 3 people. My work has been kind enough to supply a pool car for the journey so there would be no charge to hitch a lift. I will be leaving Ballarat on the Saturday morning sometime, and leaving Wagga Wagga on Anzac Day morning. If you are interested send an e-mail to the address on the Code Camp Oz 2006 travel page and mention my name.

Problems adding ASP.NET custom controls to the toolbox (VS.NET2003)

Well after swearing at the screen and jumping up and down for the last hour I have figured out my problem: which was getting an error message when trying to add an ASP.NET custom control to the toolbox in Visual Studio .NET 2003. The message was something linke "Unable to load assembly <assmebly path>. Check that any required dependencies are installed". The .dll in question was a very simple ASP.NET control library containing 2 custom controls I wrote ages ago. After mucking around with and opening and closing files, re-compiling and citing various ancient religious chants I had an epiphany. The .dll I was trying to add was on our build server, which I hadn’t set up a .NET security policy for! So I just added a new Code Group for the build server path with FullTrust rights and hey presto, the thing added! Hope this helps someone.

ASP.NET 1.1 & 2.0 on Windows XP breaks the VS.NET 2003 debugger

I rebuilt my system only last week due to it going to "blue-screen heaven" and hadn’t tried to debug anything in VS.NET 2003 until today.  Imagine my horror when I received a nasty message from VS saying the debugger failed to start on this server (localhost).  The only thing majorly different from my last build was that I have v2.0 of the .Net Framework installed.  Turns out the registration of ASP.NET 2.0 stopped the 1.1 debugger from starting because when I ran "aspnet_regiis -u" from the v2.0 framework folder to uninstall ASP.NET 2.0, the debugger started working again!
It seems a little strange that the two won’t work together so maybe there is a way to have them co-exist on the same dev. machine that I don’t know about.  If anyone reading this does know, please leave a comment!

WinForms Validation Code

When trying out some of the new WinForms features I quickly set about seeing how validation in winforms had changed. Turns out it hasn’t 
You see, my history is in web development and as such I have enjoyed one of best features of ASP.NET 1.1, the validation controls. When I went to create my first WinForms application I was shocked that there were no equivalent controls for doing form validation. Instead you get the ErrorProvider component (extender control even?) that you can use along with the appropriate control and form events to display a little icon next to controls that need attention. Hmmm, not quite the same development experience as ASP.NET. So I went about devising a routine for validating forms in WinForms.
In the end all it is is a few IsValid() methods but I think it makes it fairly simple to setup validation code and use the error provider. First of all, there is an IsValid() method that takes the control to validate and a string to store any validation error message. It returns a boolean to indicate whether the control’s value is valid. The body is basically a large case statement (on the control’s name) containing the validation logic for each control. Simple enough.
This method is used in a couple of ways. Firstly it is used by universal handlers for the controls validating events (or other events if more apppropriate) to set the error provider message on the controls. Secondly it is used by an overload of the IsValid() method that is for validating the whole form, or any group of controls really.
The second IsValid() method takes a Control.ControlCollection and a StringCollection to return the validation messages in. It just loops through the controlCollection and calls the first IsValid() method for each of them. Fairly simple but as I said, it results in a fairly clean and as easy to maintain set of validation functions.
You can grab the code here.

VDNUG Hands-on Day

The newly formed Victoria .Net User Group had its hands on day over the weekend which I was luck enough to get a seat at. I had been up late most nights last week working on my latest uni assignment so the 5:40 AM start on Saturday was a bit of a challenge, although to my surprise it was bright and beautiful at that time of morning, and the drive to Melbourne was quite enjoyable with little traffic to be seen.
Highlights of the day for me were experiencing the improved IDE of VS2005 for the first time while actually writing code. I am going back to working on a WinForms project this week so I was keen to see what improvements had been made there. Turns out a heap! I am seriously considering porting the current project straight to VS2005 Beta 2 as the productivity gains seem to be huge. I also think the ClickOnce technology could be a real step up from the current MSI setup I have. Seeings as there is less than a month to the launch of the final product, it seems a little backward to keep developing new projects in VS2003 so the next week or two will see me exploring whether that idea really is workable in our environment or not.
Here’s hoping!