CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

Exception message doesn't propagate from an out-of-process WinRT server

Open hez2010 opened this issue 1 year ago • 0 comments

Describe the bug When calling to an out-of-process WinRT server, any exceptions from the server will become a COMException without any exception message on the client.

To Reproduce

  1. Clone https://github.com/hez2010/WinRTServer
  2. Checkout the branch eh-repro: https://github.com/hez2010/WinRTServer/tree/eh-repro
  3. Build and run

Expected behavior The exception should contain the exception message from the server ("Exception from server").

Actual behavior No helpful exception messages.

System.Runtime.InteropServices.COMException (0x80131500)
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|39_0(Int32 hr)
   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.WinRTServer.ITestClassClassMethods.Test(IObjectReference _obj)
   at WinRTServer.TestClass.Test()
   at Program.<Main>$(String[] args)

Version Info CsWinRT 2.0.7

Additional context

hez2010 avatar Apr 06 '24 13:04 hez2010