tags:

views:

73

answers:

1

Hello, I have my app, using functionality that is based on unity application block. Sometimes I need to throw ResolutionFailedException manually. In v1.2 constructor of ResolutionFailedException had three parameters - typerequested, namerequested and exception. In v2.0 fourth parameter was added - buildercontext. I'm not creating it manually, so I have no reference to it and no idea where I can get it. Roughly speaking, I'm only overriding Resolve method in particular way and I'm not interfere in standard mechanism of policies, strategies and so on. Could anyone help?

+1  A: 

Actualy this exception is not supposed to be called by developer, anyway you can call it following way

    throw new ResolutionFailedException(
            typeof (IConcreteService), 
            "IConcreteService", 
            null, 
            new BuilderContext(null, null, null, null,                    NamedTypeBuildKey.Make<IConcreteService>("nameOrNullIfResolvedNotNamedInstance"), null)
            );
er-v