Colin Mackie - 487 - Feb 13, 2014

Anyone have suggestions for the best way to debug routes?

I have one that is just returning a RequestBindingException and for the life of me I can’t see anything wrong.

ok great. also SS.Text can serialize pubilc fields by setting:
JsConfig.IncludePublicFields = true;

But IMO you should only use public properties in DTOs.

You should be able to debug the symbol sources published with the NuGet packages, i.e: https://github.com/ServiceStack/ServiceStack/wiki/Debugging#wiki-debugging-source-symbols-in-nuget-packages

Colin Mackie:

Thanks, I had tried that but the symbol servers were returning 404 for 4.0.10.

Do you mean you added them in VS.NET’s Tools -> Options -> Debugger -> Symbols and they said they didn’t exist?

Colin Mackie:

I added the settings per that page, and when I try and view symbols I get:

SYMSRV:  http://srv.symbolsource.org/pdb/Public/ServiceStack.pdb/2FAAC5C652234480BA71688B405D526F185/ServiceStack.pdb not found

(for each repository).

I think a response went missing here, as it’s not showing up. Is this still a problem after a VS restart? 

Otherwise other things I can think of is to enable logging if you haven’t already.

Give a console tracer to the text serializers with:
JsConfig.Tracer = new ConsoleTracer();

Add break points in the Customized Error Handling options so you can inspect the exception, the Binding exceptions should have an inner exception you can look at:
https://github.com/ServiceStack/ServiceStack/wiki/Error-Handling

Colin Mackie:

Well, yes and no. If I look though my symbol cache folder, it has many of the ServiceStack pdbs for ServiceStack.Client, .Common, etc, just not for ServiceStack.dll itself. Could it be missing?

I’ll try the inspecting the exception.

Colin Mackie:

Well, that did it. Thank you for pointing me in the right direction.

Viewing the inner exception. Turns out I made that classic mistake of having a DTO property defined as :

public int Id;

instead of

public int Id { get; set; }

Guess I need better logging :slight_smile: