Using a TransactionScopeActivity with a WCF ReceiveActivity revisited

Last year Marcel and I worked on a problem using a TransactionScopeActivity inside a WCF ReceiveActivity. I blogged a number of time about our finding, for example here. Last week I heard from Marcel that a hotfix was finally available that solves this problem. He blogged about it here. Great work to see there is a fix for this serious problem. Enjoy! [f1][f2] And now on Twitter at http://twitter.com/mauricedb.

Looking back at the MVP Summit

Last week lots of MVP, myself included, where in Redmond visiting Microsoft on our yearly MVP pilgrimage. The MVP Summit is always a great event. Not only do we get to talk to the MS team members who actually design and build all the software we love and use but we also get to meet each other. And with MVP’s being located around the world that is kind of rare as well. Despite this being a great event I still have very mixed feelings about this last MVP summit. The problem isn’t the events itself or the people I met, … Continue reading Looking back at the MVP Summit

Presenting at VB Central

Next week, on march 10th, I will be doing a presentation on getting started with WCF at the VB Central user group in the Netherlands. Its a free event so if you are in the neighborhood feel free to drop by. They do ask you register beforehand. Besides my session on WCF there will also be a session on using WPF and data binding. Mode details and the registration page can be found here. Hope to see you there. [f1] [f2]

Handling HTTPS SSL certificate errors

When using self created SSL certificates with HTTPS WCF endpoints you might run into certificate validation errors. The best solution of to make sure all your certificates are fully trusted but sometimes that might not be an easy thing. The next best thing is to the the ServicePointManager.ServerCertificateValidationCallback and have add your own function to validate the certificate. This way you can ignore invalid certificates and keep going as if everything is well. Take care though as this might open up a can of worms in a production environment. Enjoy! [f1][f2]

Patterns & Practices release Prism version 2

The Patterns & Practices group at Microsoft have just released Prism version 2. I am pretty exited about this because Prism version 2 supports both WPF and Silverlight. And as it makes extensive use of the Model – View – ViewModel amongst other design patterns it is a great place to learn, even if you don’t use it as is. Check out the main “Composite Application Guidance for WPF and Silverlight” page here. Or read Blaine Wastell about it here. Enjoy!

Lazy loading using Ninject

In my previous blog post I demonstrated how you can use Ninject in your Silverlight application to automatically inject dependencies and make live easier. In the sample I injected the dependency, the PingService, inside my PageModel constructor. That worked just fine because the PingService is lightweight and stateless. However suppose creation is much more involved and you don’t need it all the time so you really want to divert creation until you really need the PingService. Well we can by just a few simple changes.   Changing the PageModel to defer loading of the PingService This is actually a very … Continue reading Lazy loading using Ninject

Using Ninject with Silverlight to make you code more testable

One useful feature when developing more complex code is using an inversion of control (IOC) container to do dependency injection. The basic principal of inversion of control, or dependency injection, is to pass in any dependencies when an object is created and not create them when needed. This way the code is much more decoupled and much easier to unit test. Dependency injection with Silverlight When developing regular .NET code there are plenty of IOC containers to choose from. However when it comes down to Silverlight the choice isn’t quite as big. I am aware of only two IOC containers … Continue reading Using Ninject with Silverlight to make you code more testable

Gotcha with HostingEnvironment.MapPath()

When developing WCF service the System.Web.Hosting.HostingEnvironment class is kind of useful as it will give you all sorts of information about the runtime environment of where you app is hosted. string path = HostingEnvironment.MapPath(@"\MyFile.txt"); Now the problem is it only works when the service is hosted inside IIS, or the Cassini development server that comes with VS2008, not when the service is self hosted. Guess that makes sense but it is kind of easy to start with a WCF Service Library project template, even when you finally intend to host the service under IIS. The problem is that the development … Continue reading Gotcha with HostingEnvironment.MapPath()

Returning exception information to a Silverlight client through WCF

Error handling code can be a drag but the simple fact is that everyone needs to write it because runtime errors can and do occur. Developing a Silverlight app is no different here, exceptions will occur and you as a developer will need to deal with them. One of the common things in Silverlight is communicate with a server through WCF and as soon as we start executing code on the server that is just another place where errors can occur. No big deal you might think as that is the same with any other application using WCF. Well the … Continue reading Returning exception information to a Silverlight client through WCF