Hab folgenden code:
var bind = new PollingDuplexHttpBinding();
bind.MaxReceivedMessageSize = 2147483647;
EndpointAddress myEndpoint = new EndpointAddress(address);
try
{
var instContext = new InstanceContext(this);
var fact = new DuplexChannelFactory<IVisuWcfService>(instContext, bind);
var channel = fact.CreateChannel(myEndpoint);
this.visuServices.Add(visuService.Name, channel);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message+ex.StackTrace);
}
das try / catch habe Ich im Moment nur geschwind als hack für den Designer eingebaut.
So nun das ganze:
Ich Hab diese Klasse in meinem DataContext, d.h. es wird zur Designzeit ein Objekt davon erzeugt. Dann bekomme Ich aber folgenden fehler:> Fehlermeldung:
Unable to cast object of type 'proxy_xx' to type IVisuWcfService wobei xx eine immer weiter steigende Nummer ist. Der Fehler tritt in der Zeile:
var channel = fact.CreateChannel(myEndpoint);
auf.
Wenn Ich das ganze starte, dann funktionierts!
Irgendwelche Ideen?
cSharp Projekte : https://github.com/jogibear9988