How are failed routes handled?

I’m trying to understand how failed routing / binding works. I get the following error only in production (Azure web role) but never get the error unless I handle it in UncaughtExceptionHandlers. Is there something in the SS environment I’m not aware of here? Shouldn’t it have failed in development as well? Perhaps a web.config setting?

For example in production I was getting the error “Could not find property Name on Admin” which was because I forgot to add the property Name on my Admin DTO. I never saw the error raised in development. The service runner was never executed either.

Here is the route and DTO (unfixed)…

[Route("/admin/{Name*}")]
public class Admin : RequestBase
{
}

Thanks,
Stephen

If you don’t have the Name property in your Request DTO and you’re using it in your Route it should fail. But in order for it to be recognized as a Service the Request DTO needs an implementation in a Service class.

It’s unlikely to have worked in development, maybe you were running old/dirty builds? Are you saying that a Request DTO without the Name property works? What happens when you try to call it?

Correct. I never expected this to actually work and it doesn’t in either environment. In development it’s never called. But in production I get a YSOD, which is what really brought this to my attention. I want to avoid the YSOD next time.

This would be the difference between in behavior between your local IIS WebDev/Express server vs real IIS. The Exception gets thrown on Startup so you should see a YSOD, i.e. this is a misconfiguration that is always wrong and you don’t want to ignore. You can also check if you have any Startup Exceptions by going to ?debug=requestinfo when in DebugMode=true.

Using IIS Express would explain it. I’m surprised it would behave that differently. I’ll remember this for next time.

Thanks Demis.