The type must 'xx' derive from ITraceWriter.\r\nParameter name: service

Posted by Sheonarayan under Error and Solution on 8/2/2015 | Points: 10 | Views : 2151 | Status : [Administrator] | Replies : 0

Problem

I was getting following error while registering a custom tracer in asp.net web api.
The type must 'xx' derive from ITraceWriter.\r\nParameter name: service

Solution

The solution of this problem is to specify the ITraceWriter with complete name including namespace. AS there is already a ITraceWriter in the JSON.
config.Services.Replace(typeof(System.Web.Http.Tracing.ITraceWriter), new CustomTracer());

This solves the problem.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com



Responses

(No response found.)

Login to post response