Question

I've got a problem where incoming SOAP messages from one particular client are being marked as invalid and rejected by our XML firewall device. It appears extra payload data is being inserted by Visual Studio; we're thinking the extra data may be causing a problem b/c we're seeing "VsDebuggerCausalityData" in these messages but not in others sent from a different client who is not having a problem. It's a starting point, anyway.

The question I have is how can the client remove this extra data and still run from VS? Why is VS putting it in there at all?

Thanks.

Was it helpful?

Solution

A quick google reveals that this should get rid of it, get them to add it to the web.config or app.config for their application.

<configuration>
  <system.diagnostics>
    <switches>
       <add name="Remote.Disable" value="1" />
    </switches>
  </system.diagnostics>
</configuration> 

The information is debug information that the receiving service can use to help trace things back to the client. (maybe, I am guessing a little)

  • I have proposed a follow up question to determine were the magic switch actually comes from.

OTHER TIPS

For remove 'VsDebuggerCausalityData' you need stop de Visual Studio Diagnostic for WCF using this command:

VS 2008 -> c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>vsdiag_regwcf.exe -u VS 2010 -> c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE>vsdiag_regwcf.exe -u

I hope this help you or other people.

Darryl's answer didn't work for me. Each developer has to do ggrocco's answer.

I ended up writing a MessageInspector, and adding this code to the BeforeSendRequest method:

int limit = request.Headers.Count;
for(int i=0; i<limit; ++i)
{
    if (request.Headers[i].Name.Equals("VsDebuggerCausalityData"))
    {
        request.Headers.RemoveAt(i);
        break;
    }
}

Based on an answer by @Luiz Felipe I came up with this slightly more robust solution:

var vs = client.Endpoint.EndpointBehaviors.FirstOrDefault((i) => i.GetType().Namespace == "Microsoft.VisualStudio.Diagnostics.ServiceModelSink");
if (vs != null)
{
    client.Endpoint.Behaviors.Remove(vs);
}

Or use "Start without debugging" in Visual Studio.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top