Category Archives: WCF

WCF Tips

Generally I find that it’s a codegen issue and most of the time it’s because I’ve got a type name conflict it couldn’t resolve.

If you right-click on your service reference and click configure and uncheck “Reuse Types in Referenced Assemblies” it’ll likely resolve the issue.

What I found was that enums must be tagged with [EnumMember] attribute for the auto-generation to work


WCF behaves differently when hosted in UI thread. In such scenario all request are processed in sequential order in standard windows message loop so if you call the service you blocked your current thread but the service calls back your client and it waits to process the message but it can’t because thread is blocked by the initial call = deadlock until initial request timenouts. By using last mentioned behavior you will say WCF to not join windows message loop and instead process messages in separate threads as usual. There is no security issue with this except the fact that you cannot access UI control from methods running in other threads – both WinForms and WPF has approaches to pass commands from other thread.