Problem with Exception Handling in WCF, try catch not work -


i have wcf service (nettcpbinding, duplex) wich works well. today hit wierd problem. following code runs fine , if "new a("123");" throws exception, catched.

[servicebehavior(instancecontextmode = instancecontextmode.persession, concurrencymode = concurrencymode.single)] public class service: itestservice {    // interface defined [operationcontract(isoneway = true)], fire , forget   public void test()   {     try     {          var t = new a("123");     }     catch(exception ex)     {}    } } 

but if change a.dll , change method parameters, expect missingmethodexception. nothing wcf:( wcf service abort , on client side faulted event wcf channel.

so why catch not work? wcf handle such xceptions on way?

thx help

the failure doesn't happen @ point when create a, fails @ jit compilation of method test outside of try/catch block.

if move creation of method , call try block catch exception

something this

[servicebehavior(instancecontextmode = instancecontextmode.persession, concurrencymode = concurrencymode.single)] public class service: itestservice {    // interface defined [operationcontract(isoneway = true)], fire , forget   public void test()   {     try     {          var t = geta("123");     }     catch(exception ex)     {}    }    private geta(string s)   {       return new a(s);   } } 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -