We are creating a Silverlight application and have calls to the Silverlight-WCF service. When I run the application from Visual Studio, everything works fine. When we deploy the site and launch the application, we get the following error (or the same as it) with every call to the web service.
Message: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at SSS.MVVMCore.Silverlight.WebPortalService.GetThemeIdCompletedEventArgs.get_Result() at SSS.MVVMCore.Silverlight.ViewModels.StandardBaseFrameViewModel.<.ctor>b__0(Object s, GetThemeIdCompletedEventArgs ea) at SSS.MVVMCore.Silverlight.WebPortalService.WebPortalServiceClient.OnGetThemeIdCompleted(Object state) Line: 1 Char: 1 Code: 0 URI: http://ssswebportal.com/login.aspx?p=d53ae99b-06a0-4ba7-81ed-4556adc532b2
Based on his message, the call is called, it is fully executed, but when he tries to deserialize the results in the Silverlight application, something will go wrong. Any suggestions on what is happening and what can we do to fix it?
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<FOLLOW UP β β β β β β β β β β β β β>
That was our resolution:
In the ServiceReferences.ClientConfig file, we had the following code:
<client> <endpoint address="http://localhost:5482/WebPortalService.svc" binding="customBinding" bindingConfiguration="CustomBinding_WebPortalService" contract="WebPortalService.WebPortalService" name="CustomBinding_WebPortalService" /> </client>
Note the line "localhost". It should be our web server address when published, but it must be local during development.
Does anyone have any suggestions on how to do this automatically, so we donβt need to manually change this line before publishing?
Erocm source share