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!
8 Comments |
Silverlight, Visual Studio | Tagged: Silverlight |
Permalink
Posted by Jordan
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
1 Comment |
Off Topic, Random but serious | Tagged: Blue Screen Of Death, BSOD, Dell |
Permalink
Posted by Jordan
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!
11 Comments |
Silverlight, WCF, Web Services | Tagged: Silverlight, WCF, Web Service |
Permalink
Posted by Jordan