In my WCF client code I add a message inspector (using an IEndpointBehavior).
class MyBehavior : IEndpointBehavior { public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime) { clientRuntime.ClientMessageInspectors.Add(new MyMessageInspector()); } } public class MyMessageInspector : IClientMessageInspector { public object BeforeSendRequest(ref Message request, IClientChannel channel) { Console.WriteLine(request.Properties.ContainsKey(HttpRequestMessageProperty.Name)); } } Now here comes the part I do not understand:
When I make a WCF call using a proxy configured to use this behavior, the following happens:
- If the call is made from a process running inside the VS2015 debugger,
Trueis printed to the console, meaningrequest.Properties["httpRequest"]is present. - If the call is made from a process running normally (not in the debugger),
Falseis printed to the console.
- If the call is made from a process running inside the VS2015 debugger,
Why is WCF configured differently when running inside/outside the VS2015 debugger? How does this happen? Is it documented anywhere?
0 comments:
Post a Comment