WCF plugin

WCF plugin for RevDeBug

Estimated reading time: 1 min

Last edited: 16 Apr 2020

RevDeBug WCF plugin allows you to capture exceptions thrown within the Windows Communication Foundation processing pipeline.

Installation

This plugin is provided in form of a RevDeBug.WCF NuGet package, which should be added to the WCF project. This package will add new behavior extension called RevDeBug.WCF.ErrorHandlerExtension. For the plugin to work correctly, we must modify the WCF project web configuration (the web.config file) to attach the mentioned behavior extension (crucial elements in bold):

web.config

<?xml version="1.0"?>
<configuration>
  <system.serviceModel>
	<extensions>
	  <behaviorExtensions>
		<add
		  name="rdbErrorProvider"
		  type="RevDeBug.WCF.ErrorHandlerExtension, RevDeBug.WCF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
		/>
	  </behaviorExtensions>
	</extensions>
	<behaviors>
	  <serviceBehaviors>
		<behavior>
		  <rdbErrorProvider />
		</behavior>
	  </serviceBehaviors>
	</behaviors>
  </system.serviceModel>
</configuration>

Declare rdbErrorProvider in behaviorExtensions with RevDeBug.WCF.ErrorHandlerExtension type. Then add rdbErrorProvider to existing behavior in serviceBehaviors or create a new behavior if serviceBehaviors is empty.