What does ServiceMissingException mean

Topics: CAB & Smart Client Software Factory
May 20, 2006 at 10:02 PM
originally posted by: GregShaw

I have a Presenter with 3 ServiceDependency arguments to the constructor.
Whenever I construct a View that uses this Presenter I get a ServiceMissingException saying that the IContactsServiceAgent is not available in this context.
Does anyone know what this exception means? I have struggled with it and have no clue.

Thanks, Greg.
May 25, 2006 at 8:37 AM
originally posted by: mmbaker65

I have seen this occur when you add/declare a service but wish to access the service via a secondary interface. The service is "registered" with the interface (or class) you specify. If you attempt to reference the service via ServiceDependency using an alternative interface that it supports you will get this message.

The solution is to call WorkItem.Services.AddNew with your service object and the interface you wish to reference it by. Typically, people only register the object and neglect specifying an interface because they intend to reference it via the classname.

Hope this help,
Mark

Mark Baker
Host, CMP DevNet .NET Cast
http://www.ddj.com/podcast/dotnetcast