Compact framework WCF, Disco files, netcfsvcutil
When using the 3.5 version of the compact framework it is possible to connect with wcf services. This is because the CF 3.5 contains a limited subset of the wcf technology. There are several blog posts listing the wcf capabilities in CF e.g.: http://blogs.msdn.com/andrewarnottms/archive/2007/08/21/the-wcf-subset-supported-by-netcf.aspx
We were researching for a mobile client to connect to a wcf service running at one of our servers. The requirement is that transport is secured by using HTTPS protocol.
The first problem was creating a client side proxy. Since the SvcUtil doesn’t work for the CF we had to look for an alternative. After some googling we found the netCFSvcUtil which is basically the same as the svcutil, but it generates a proxy specifically for CF. You can find it as part of the Power Toys for .NET Compact Framework 3.5. For more on this you can read this excellent blog post by Andrew Arnott
When you get this generated client proxy there is another problem. It expects that you are using HTTP. Since we need HTTPS that’s a problem. Thanks to Damir Dobric we found how to make the proxy use https instead of http.
System.ServiceModel.Channels.CustomBinding binding = new System.ServiceModel.Channels.CustomBinding(); binding.Elements.Add(new System.ServiceModel.Channels.TextMessageEncodingBindingElement (System.ServiceModel.Channels.MessageVersion.Soap11, System.Text.Encoding.UTF8)); System.ServiceModel.Channels.HttpsTransportBindingElement https = new System.ServiceModel.Channels.HttpsTransportBindingElement();
https.RequireClientCertificate = false;
binding.Elements.Add(https);
This way your client proxy is now HTTPS enabled.
Another problem we had was that the disco file was downloaded from the “wrong” location. We have a wildcard certificate in place for our HTTPS like *.domain.com. We were accessing the service using https://laptop1.domain.com/wcf/service.svc. Although this url works fine when we browsed to it, there was an issue when we tried to generate a client proxy. It seemed that both svcutil as netcfsvcutil were trying to download the DISCO file from https://laptop1/wcf/service.svc?Disco. When we browsed to this link it worked just fine. The problem is in the url and the wildcard certificate. Since the disco url didn’t include the domain.com part in its url the utils were not able to establish a trust relationship over ssl with the web server. This is perfectly normal since it does not correspond with our wildcard certificate.
The solution is to update the https binding in IIS by giving it a host header. Now this is something you can’t do in the IIS control panel. There are 2 ways of doing this: Using scripting or using the metabase explorer that can be found in the IIS 6.0 resource toolkithttp://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/993a8a36-5761-448f-889e-9ae58d072c09.mspx?mfr=true
A last advice don’t fall into the same trap by thinking that a wshttpbinding is required to do HTTPS, it’s perfectly possible by using a basichttpbinding where the security mode is set to transport.
Visual studio .net 2010 & .net Framework 4.0 CTP
Today I found that the first CTP for visual studio .net 2010 and the .net framework 4.0 is available for download. If you want a quick overview of some of the new features go to this website: http://msdn.microsoft.com/en-us/vs2008/products/cc948977.aspx
If you want to download the CTP you should go to the Microsoft Connect page
If only …
A application menu like the one you can see here is something I wish for every day at work. It would really make life easier
Just wondering in what language it was programmed because I really wonder how they got it to compile
MSMQ Message priority
In my recent development I’ve been using msmq to store messages that can’t reach a wcf service when it’s not available. I was setting the Message (System.Messaging) property Priority so that the queue would prioritize the incoming messages.
However when I looked at the queue all the messages their priorities where 0 or “Lowest”. It seems to be because my queue is transactional (which is a requirement for the msmqintegrationbinding). It was a bit of a disappointment that I couldn’t control the priority using the native msmq features, but hey that’s the price I had to pay for some other great functionality.
WCF: msmqIntegrationBinding
Today I discovered the msmqintegrationbinding in the windows communication framework.
This binding is especially to allow wcf services to process message that are put in a message queue by some legacy program. The advantage of this is that you can do this without the need to change the legacy client.
If you want more information on how to use this binding have a look at this post at Simon Evan’s blog
There was something I liked in particular and it was exactly what I was looking for; I’m working on a custom logging framework adapted to our needs. To keep it simple let’s say that a Log class sends messages using the fast netnamedpipebinding in wcf to a service. This works fine, but what when the service is unavailable? Well I’ve designed the Log class to automatically failover sending the message it would normally send to the service to a queue. This way I don’t lose any of the log messages. The advantage I mentioned above is that when I reset the service (launch it again) it automatically starts processing the messages (logs) in the queue as well as accepting new log messages using the named pipes. So this way I achieve our main priority: deliver the log messages as fast as possible, but without losing them when the service is down.
var crash = from feature in visual studio where feature.name.Contains(Silverlight 2.0 tools) select feature
i’ve been struggling to get the RC1 of the silverlight tools for visual studio .net 2008 going. So far I’ve tried the following:
- turning off UAC
- Repairing Visual studio setup
- SubinAcl from the following blog: http://petesbloggerama.blogspot.com/2008/01/fix-requested-registry-access-is-not.html
- Running vs.net as administrator
I always get the following error message:

Personally I really am starting to hate the whole silverlight technology. The first version was crap because you had to be some guru to be able to program something fancy looking and now the second version is out and the tools are crap. So what’s next crappy visual studio .net 2010 all together? I really would like the guys at MS to take it a bit slower so they can increase the quality of their products.
Installing Microsoft Team Foundation Server SP 1
I was trying to install the new Team Foundation Server 2008 the other day. I wanted to install it in an dual machine configuration, meaning that I wanted to separate the database from the application server.
To do this I downloaded the new Vmware Server 2.0 which is actually a “light” version of the VmWare Infrastructure 3.0. I’ve installed 2 guest machines running both Windows Server 2008 Enterprise Edition.
An additional requirement is that the TFS server uses the new Sql Server 2008. And here is the problem. “To use Sql Server 2008, you must install Team Foundation Server Service Pack 1″. But how can you do this when all you’ve got is the RTM version of TFS and a separate download of the service pack…
Well if you download the latest TFS installation guide from Microsoft (version 8.0.080908). Somewhere in there you’ll find a small entry on how to merge the service pack with the tfs installation files. When you follow this guide like I did you might encounter an error from MSI with error code 2203. When this is happening you should try to do the following:
- Run the command from a command prompt with elevated privileges
- Grant Full Controll permissions to the SYSTEM user on the folders where you’ve copied the installation files from the dvd.
And finaly the very important make sure that the installation files you’ve copied from the dvd are NOT marked as read-only!!! This last thing solved the problem for me.
New found passion
I’ve always liked music a lot, especially dance music. My favorit genres are techno & minimal and some other ones. I discovered that if you like this kind of music that there are some good sources to get more information on what is hot at the moment.
One site I would to mention is Beatport.
This is music download site (legal) that focusses on the dance music around the world, you’ll find lots of genres on their site. It’s there I discovered some of my favorit artists like Kolombo, Henrik Schwarz, … Prices are democratic but sometimes you just don’t want to pay for it. If that sounds like you I recommend the to beatport burners podcast. This is an interactive podcast that brings you the new release in the scene and you can listen to full versions. When you hear something you like you can use the interactive feature to go directly to beatport and purchase the track.
Another nice source is Essential Music Blog
This is a blog-like site - as the name indicates - where releases are posted. I haven’t been able to discover if this site is legal, but since it seems to be sponsored by beatport I guess it is. Anyways it’s an excellent source to discover new artists.
Podcasts:
Beatport burners (on itunes)
Beatport burners (rss feed)


