Azure - Still a Tech Preview!

It seems that I’ve managed to break my Azure account – after starting to configure SSL endpoints, and uploading the new package I received this error:

Broken Azure

But now all my packages just sit in the “Initializing” state and there seems to be nothing I can do to kick them into life…

Silverlight 2.0 GDR1 and TFS Build Server

I’ve just encountered a really strange problem regarding Silverlight 2.0 GDR1 release and our TFS Build Server at work.

First up, there does not seem to be any way to run the GDR1 installer on the server, so no way of updating the SDK on the build server. Great. I initially didn’t think anything of it, unpacked the installer and ran the MSI contained within. And all seemed fine.

The we noticed that builds were different between the local dev machines and the build server; in that they worked locally and threw a mixture of (seemingly) random errors on the server builds. As our system is setup to pull builds only from the build servers to populate our live and test setups, this was obviously a critical problem.

After some digging, it seems the Silverlight 2.0 SDK had NOT been updated; even after running the Silverlight 2.0 SDK msi and it seemingly installing without error.

I ended up pulling a copy of the updated files from a working Dev box to the server and extracting them, and all seems well.

Fingers crossed!

I hope Microsoft will fix this omission, or at least make it slightly more obvious where to find the relevant updates for TFS installations – a lot of people, like us, do not install Visual Studio on our build platforms!

TFS 2008 Build Notifications

One thing that I was looking into this morning is adding Build Notifications to our work TFS Server. Now, initially I thought I’d do this via e-mail, but none of us want more junk appearing in our inbox.

The I thought a small systray app.

A quick google later came up with the answer!

Silverlight still needs work ..

I’m amazed at how many small parts of Silverlight need a lot more polishing. I recently hit the problem mentioned here - – when building a login dialog for our work application. Disabling the text boxes works great. Enabling them … oh dear, so but that just doesn't work all the time :)

Silverlight: Treating Tab == Enter

In software development it’s typically the way that data entry screens handle the Return or Enter key as a Tab.

It seems this functionality is missing from the current Silverlight 2.0 controls.

I had to roll my own implementation quickly this morning, although it’s probably not the best, it does work :)

    public partial class fieldText : UserControl
        public fieldText ()

        public event KeyEventHandler OnEnter; 

        public string Text
                return content.Text;

                content.Text = value;

        private void content_KeyUp(object sender, KeyEventArgs e)
            if (e.Key == Key.Enter)
                OnEnter(sender, e);

Obviously, I go on to use the OnEnter handler in my actual page to relocate the user’s focus – note that I am using my own custom control that has a TextBox within it, which is why I had to expose the event.

WCF, Web Farms and Context

One thing that I have recently encountered is mixing WCF and Web Farms while maintaining context.

It seems the only way of doing this is  to use the ASP.Net Compatibility layer, which, to say the least, is far from elegant.

More research needed …

Generics and Array - Lists in C#

Just read an interesting article in the August 2007 MSDN Mag; to be specific, its the regular CLR Inside Out feature.

They go into the differences of .NET 1 Array Lists and .NET 2 Generics - and that in 99.9% of cases (ok, I'm paraphrasing here!), you should use generics wherever humanly possible in .NET 2 due to the performance benefits.

Well, there you go - that's it from the horses mouth so to speak!

ArrayList vs List Generics

I was having an interesting debate with a programmer in the company I now work for (Blueberry Consultants) over which was better; ArrayList or the new List<> Generic introduced in .Net 2. He was firmly for ArrayList, and I believed List<>. For example, you could use both to store a String list such as: ArrayList ArrayList lMyStringList = new ArrayList(); string lTempString = "Example code!"; lMyStringList.Add(lTempString); Generic List<> List<string> lMyStringList = new List<string>(); string lTempString = "Example code!"; lMyStringList.Add(lMyStringList); Both the above give you exactly the same result, but on the Generic list you can only assign strings to the list - anything else will raise an exception (I find this a very handy feature personally). If you wanted to store a multitude of types, simply inherit from a common base, and use the base as the list identifier. Use .GetType() == typeof(Whatever) to work out what type the object is and create a new typecast when you need to work with it. Simple and safe. Finally, technically speaking, ArrayList does a lot of boxing operations (because it can take any type). The Generic List does not. This means Generic Lists are more efficient :) On both memory and CPU cycles :) I can feel an optimisation urge coming on.

.Net Security - not bad!

I've just discovered something quite neat in the security model for .Net (well, .Net 2 - haven't tested .Net 1 or 1.1). Last night, I discovered my desktop clock was going WAY out of sync, so I thought I'd migrate my Delphi written NTP client to C#. All was well. This morning I copied it onto my file server, and started it. And received the following.

.NET Security Warning

Yes, I know, I'm a geek. But thats cool! It detects, and blocks, internet access on EXE's ran from a remote (untrusted) source.