I'm testing a trivial web role under Azure Compute Emulator and have overridden OnStart()
, Run()
and OnStop()
methods in my class that derives from RoleEntryPoint
.
OnStart()
and Run()
are called but OnStop()
is not - I will either press "Stop debugging" in Visual Studio or close the browser window and the role will be terminated, but OnStop()
is never called. I've checked - the override
keyword is present in OnStop()
definition.
That's not very convenient - it means I can't test my OnStop()
outside a live cloud.
Can I somehow make Compute Emulator call OnStop()
in my role?
I suspect (but I'm not sure), that if you open the compute emulator UI and "stop" the deployment there, OnStop() should be called.