0

I'm trying to develop a WinRT library in C# that exposes some classes with public properties of type IObservable to make use of Reactive Extensions for .NET. The documentation for Rx.NET states that, as of v5.0, WinRT is fully supported as long as you're targeting Windows SDK v19041. I set my Target Platform to 19041 and built a class that exposes an IObservable property and it doesn't compile...giving me the whole IObservable "is not a valid Windows Runtime type" compile error.

So...am I missing something that will allow me to use IObservable? If not, does anyone know a workaround? The point is that I want libraries/applications that consume the library to be able to use Rx.NET to Subscribe to these observables so, really, any solution that allows that would be fantastic!

jasonxz
  • 139
  • 1
  • 9
  • You should show some code of what you tried, or better, provide a small reproducible sample https://stackoverflow.com/help/minimal-reproducible-example – Simon Mourier Jul 24 '22 at 07:34
  • Can you Nuget `System.Reactive`? – Enigmativity Jul 25 '22 at 00:53
  • 1
    Yes. I can install System.Reactive & System.Reactive.Linq and it works fine until I publicly expose IObservable. I'll try to publish a sample tomorrow...I just started COVID symptoms this morning so it may be a few days, though. – jasonxz Jul 25 '22 at 02:50
  • Here's a link to an example: https://1drv.ms/u/s!AhymD3N3Dxn_rfoo0Gck_hw4qFhIaw?e=XCCqne – jasonxz Jul 29 '22 at 21:32

0 Answers0