Reduce your XAP file size in seconds

October 31, 2008

Want to make your Silverlight XAP packages smaller? It couldn’t be easier!

Extract the XAP file (rename to .ZIP and use any extractor). Then… re-compress it using a good ZIP tool, like WinRAR.

Third party zippers are far more efficient than the one built in to Visual Studio.

In my trial, I got a 280k file down to 220k!


Dell m4400 Blue Screen

October 30, 2008

I recently purchased a Dell Precision m4400 notebook. All was well for a few weeks until out of the “blue” it started blue screening on boot. Safe mode reported some VMM start-up problem, which didn’t really mean much to me (I assumed it was Virtual Memory Manager).

So I did’t what all good developers do, cracked the s#!$% and formatted it. All was well for another few days. Then it started again – this time I was completely sure I hadn’t changed something.

This time, rather than jumping in and reformatting, I decided to try “investigation”.

Long story short, it was an option in the BIOS, on the Virtualistaion tab, “Enable Direct I/O” or something similar. I disabled this and no more bluey :)


Get a relative URI to your Web/WCF Service in Silverlight

October 21, 2008

How do you get a relative URI to your web service / WCF service?

It’s pretty easy:

  • Create a binding
  • Create an EngpointAddress
  • Instantiate the client proxy

<Sample Code>

Get a relative URI to your Web/WCF Service in Silverlight Sample

</Sample Code>

Note: The downloadable sample is in C# whereas the samples in the article are in VB.NET :)

Dim binding As New BasicHttpBinding(BasicHttpSecurityMode.None)
binding.MaxReceivedMessageSize = 10000000

Dim endpoint As New EndpointAddress(someUri)

service = New SomeWebServiceClientThatHasBeenAddedAsReference(binding, endpoint)

Nice and simple, but there is an issue with portability. What if you want to move the Silverlight app around and need the service URI to be relative. Silverlight has some cool relative URI stuff, but for some reason the EndpointAddress class doesn’t support relative URIs which makes this a little more difficult than it should be. Attempting to pass in a relative URI to it’s constructor will result in an Exception: System.ArgumentException: The given URI must be absolute.

Getting around this is pretty easy too however. Try this:

Dim uri As New Uri(App.Current.Host.Source, "../SomePath/SomeService.asmx")
Dim endpoint As New EndpointAddress(uri)

Note the App.Current.Host.Source URI is where the XAP file lives – which is a great starting point. Pass in a relative URL string to this point and you can find your service (or anything else for that matter) from wherever you app lives!


Introducing the Silverlight Designer and Developer Network

October 20, 2008

It gives me great pleasure to announce the Silverlight Designer and Developer Network, a new community group in Melbourne for Silverlight designers and developers alike!

Lets meet!

The group’s first meeting is on Thursday November 27 at 5:30 PM for a 6:00 PM start. The venue is Microsoft Theatre, Level 5, 4 Freshwater Place, Southbank.

We have some great speakers lined up for you: Shane Morris from Microsoft and Jonas Follesø from Capgemini. These guys have tons of experience in Silverlight and have presented many times on the subject, including fantastic talks at TechEd.

To register interest head over to http://www.sddn.org.au. Registering your interest helps us organise the meetings!

Who will this group interest?

The focus of the group is not just on developers. Traditionally developers have had great community support, whereas designers not so much… now that Silverlight 2 is out we plan to change this.

Silverlight is as interesting for developers as it is for designers. Due in part to Silverlight’s excellent separation of design and development concerns we have new problems to solve around finding the best ways to work together.

To this end the SDDN will facilitate an ongoing discussion and promote the development of ideas and best practices for anyone who works with Silverlight.

Meetings will also include specialist topics targeted at designers or developers at a range of levels.

It’s got something for everyone :)

The Site

A big part of the group is the site, which will include all sorts of goodies once we launch it later in the year, including blog syndication and more importantly all the presentations will be available for download! Stay tuned for more updates at a later stage.

And.. please note that the current site is just a temporary site!