Proposal: InitializationFailed event to CassiniDev

Feb 25, 2011 at 6:50 AM

Hello. We use CassiniDev in our environment and it works quite well, but there's one thing that required us to modify the source code. If the server environment's initialization fails for one reason or another, Cassini gives very little information about it. That's why we made the following changes to CassiniDev\Code\Server.cs , class Server:

- Added an event Server.OnInitializationFailed that takes an exception as an argument

- Modified Server.CreateWorkerAppDomainWithHost() so that the _appManager.CreateObject() call passes true as the throwOnError argument, and there's a try/catch block that, in case of an exception and if OnInitializationFailed is defined, calls that event.

This allows us to catch and do clean handling for errors that are caused by, for example, broken web.config if we host WCF Web services under Cassini.

It would be super cool if similar functionality could be added to the official CassiniDev version so that we could use the pre-built binaries. I believe this change would keep the existing API and existing functionality exactly similar to what it is now, except for when Server.OnInitializationFailed is defined.

Cheers, Jaakko Salomaa

Mar 12, 2011 at 1:16 AM

this sounds like a good option. if you have not already submitted a patch, you are welcome to do so and I will merge it into the main branch.,

Mar 15, 2011 at 5:12 PM

Ah, sweet. I'll do that.