ResolutionFailedException - Strange Problem

Mar 16, 2009 at 5:14 PM
Hello Everyone,

I have a strange problem with unity app block. Our project has two part. Server side(Web Service), And client side(C# Windows app.) Web Service project uses unity. The strange thing is that All member of our project(except me :) ) can debug or run their programs without any problem. But if i try to debug,  I am getting following exception:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "Safir.FrontEnd.Web.Service.ServiceInterception.IBL_W_FRM_000", name = "". Exception message is: The current build operation (build key Build Key[Safir.FrontEnd.Web.Service.ServiceInterception.IBL_W_FRM_000, null]) failed: The current type, Safir.FrontEnd.Web.Service.ServiceInterception.IBL_W_FRM_000, is an interface and cannot be constructed. Are you missing a type mapping? (Strategy type BuildPlanStrategy, index 5) ---> Microsoft.Practices.ObjectBuilder2.BuildFailedException: The current build operation (build key Build Key[Safir.FrontEnd.Web.Service.ServiceInterception.IBL_W_FRM_000, null]) failed: The current type, Safir.FrontEnd.Web.Service.ServiceInterception.IBL_W_FRM_000, is an interface and cannot be constructed. Are you missing a type mapping? (Strategy type BuildPlanStrategy, index 5) ---> System.InvalidOperationException: The current type, Safir.FrontEnd.Web.Service.ServiceInterception.IBL_W_FRM_000, is an interface and cannot be constructed. Are you missing a type mapping?
   at Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.ThrowForAttemptingToConstructInterface(IBuilderContext context)
   at BuildUp_Safir.FrontEnd.Web.Service.ServiceInterception.IBL_W_FRM_000(IBuilderContext )
   at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context)
   at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)
   at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
   --- End of inner exception stack trace ---
   at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
   at Microsoft.Practices.ObjectBuilder2.Builder.BuildUp(IReadWriteLocator locator, ILifetimeContainer lifetime, IPolicyList policies, IStrategyChain strategies, Object buildKey, Object existing)
   at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name)
   --- End of inner exception stack trace ---
   at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name)
   at Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name)
   at Microsoft.Practices.Unity.UnityContainerBase.Resolve[T]()
   at Safir.FrontEnd.Libraries.IoCContainer.UnityIocContainer.Resolve[T]() in D:\My.Projects\SAFIR\Dev\branch_isyeri_1.2\FrontEnd\Libraries\IoCContainer\UnityIoCContainer.cs:line 34
   at Safir.FrontEnd.Web.Service.BaseService2`1..ctor() in D:\My.Projects\SAFIR\Dev\branch_isyeri_1.2\FrontEnd\Web\Service\BaseService2.asmx.cs:line 24
   at Safir.FrontEnd.Web.Service.BL_I_FRM_000..ctor() in D:\My.Projects\SAFIR\Dev\branch_isyeri_1.2\FrontEnd\Web\Service\BL_I_FRM_000.asmx.cs:line 28
   --- End of inner exception stack trace ---

To solve the problem, i have tried to debug into web service but it did not work.

Can anyone help me?
Thanks
Mar 16, 2009 at 10:05 PM
I'd start with the error message:

The current type, Safir.FrontEnd.Web.Service.ServiceInterception.IBL_W_FRM_000, is an interface and cannot be constructed. Are you missing a type mapping?

Is IBL_W_FRM_000 an interface? If so, are you missing a type mapping? It may be that the web service on your box isn't finding a config file.



Mar 17, 2009 at 3:16 PM
In our project, we do not use config file for type mapping.
In global.asax we have following codes. This codes are executing after Application_Start(Object sender, EventArgs e) method.

           SafirContainer.Container.Register<Safir.FrontEnd.Web.Service.ServiceInterception.IBL_W_FRM_000, Safir.FrontEnd.Web.Service.ServiceInterception.BL_W_FRM_000>();
           SafirContainer.Container.AddInterceptorFor<Safir.FrontEnd.Web.Service.ServiceInterception.IBL_W_FRM_000>(InterceptorType.UnityTransparent);