Which library should I include when making explicit calls to the client from a .NET assembly

Murph

Posted on
Dec 24 2014

Possibly something of a dumb question, but its not entirely obvious to me - especially with the recent changes to the nuget packages...

We have a WebApi application and the unhandled error stuff works a treat (or at least it does in 3, I'm upgrading to 4 as I type this). The problem I'm struggling with slightly is that we call any number of assemblies from the API application and its not clear to me what Mindscape.Raygun4Net package I should be using if I want to explicitly spin up a client to generate an error from within one of those assemblies (a.n.other random class library).

I appreciate that I should probably have a wrapper round something generic (-: But I'm taking baby steps here!


Jamie Penney

Posted on
Dec 24 2014

Hey Murph,

You can use the RaygunWebApiClient for the same things you can use the regular RaygunClient for - the only difference between the two is that the WebApi version doesn't rely on the System.Web.dll library. This was an issue for people who didn't have MVC installed on the machine they were deploying to.

If you want to grab all the same information the automatic handling would grab, make sure you call CurrentHttpRequest(HttpRequestMessage) on the client before you call Send or SendInBackground.

Cheers, Jamie


Reply