c# - Pass Exception and Subclasses over NamedPipe -


i'm trying pass objects of type exception (or 1 of it's subclasses) on namedpipe.

servicecontract:

[servicecontract] public interface iwcfcallback {     [operationcontract]     void sendexception(exception e); } 

it works fine when use this:

_pipeproxy.sendexception(new exception("bla bla 99")); 

but pass subclass:

_pipeproxy.sendexception(new argumentexception("fridgemaster 3000")); 

i exception, saying deserialisation failed.

i read knowntypes attribute, can't figure out how use classes not implemented myself.

can give me hint here?

one of "best practices" on wcf, not serialize exception.
if servicehost throwing exception, suppose use faultexception.
1 of reason why exception not safe transfer, exception serializable, can derive it, , guarantee custom derived exception serialable.

you pass data contract object exception stack string , type enum, work-around.


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -