I have an integration test which initialize a test wcf service host in code.
Recently I integrated Structuremap and wcf, and now the wcf infrastructure uses structuremap to create service instances.
One of the services I host depends on an enum.
The configuration for the service looks like this:
public class MyService
{
MyService(MyEnum enum)
{
...
}
}
For<MyService>().Use<MyService>().Ctor<MyEnum>().Is(MyEnum.Value);
When I try to resolve the service, I get structuremap error 202 (No default instance is registered for plugin family “MyNamespace.MyService”)
Any ideas what might be the problem?
Just register the type with a factory delegate: