Why I am getting the DotvvmInterruptRequestExecutionException?

Published: 12/5/2015 8:03:00 PM

When you call the Context.Redirect method in the viewmodel, DotVVM needs to interrupt processing of the current request. This is done by throwing the DotvvmInterruptRequestExecutionException exception.

There are several flaws in this approach:

  1. When you debug the project and do the redirect, Visual Studio breaks on the exception because it is not handled by your code.

  2. When you call Redirect in the try/catch block, be sure to rethrow the DotvvmInterruptRequestExecutionException and not catch it. Otherwise, the redirect will be cancelled.

How to disable the DotvvmInterruptRequestExecutionException exception in the Visual Studio

When the DotvvmInterruptRequestExecution is thrown, the exception info will be displayed. The only thing you need to do, is to uncheck the "Break when this exception is thrown" checkbox in Exception info.

Exception Alert

The alternate way is to disable the Just My Code option in the Visual Studio settings.

Exception Settings

Tomáš Herceg

I am the CEO of RIGANTI, a small software development company located in Prague, Czech Republic.

I am Microsoft Most Valuable Professional and the founder of DotVVM project.