dynamicaly changing the endpoint wcf service

Topics: Prism v2 - Silverlight 3
Apr 25, 2010 at 6:29 PM
Edited Apr 28, 2010 at 2:30 PM

Hi All,


I have a problem in changing the endpoint of my Wcf service dynamicaly. The app is working fine when the service is located in my local machine I hosted the Wcf Service on service and pointed the end point Address in Proxy but it is not working(Resolving). Here are the changes i made

Inner Exception:

{Microsoft.Practices.ObjectBuilder2.BuildFailedException: The current build operation (build key Build Key[Kiosk.Modules.Banner.ViewModels.BannerViewModel, null]) failed: Object reference not set to an instance of an object. (Strategy type BuildPlanStrategy, index 3) ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Kiosk.DataServices.Services.ParkListService.Park()
   at Kiosk.Modules.Banner.ViewModels.BannerViewModel..ctor(IBannerViewModel view, IParkListService parkListService, IEventAggregator eventAggregator)
   at BuildUp_Kiosk.Modules.Banner.ViewModels.BannerViewModel(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)}
Any help is Appretiated,










Apr 26, 2010 at 12:43 PM

While not directly addressing your problem, I saw this blog post by Tim Heuer the other day and thought it might be of use to you.


The technique can also be used in WPF.   Where I work, we have a Dynamic Configuration set of classes that we use to manage our config files, so we do not use the compile options as he suggests, but the config file setup that he uses makes sense.  How you determine what name to use is up to you.



Apr 28, 2010 at 2:28 PM

I fixed the error, Deleted the serviceReferece and all the links and added once again its working like a charm :)