Search code examples
refituno-platform

Refit 5.0 with Uno Platform fails with "MissingMethodException"


I have it working perfectly with the UWP application but as soon as I try run the Droid version I get the following error :-

Error Generation failed: System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Generation failed for Uno.UI.SourceGenerators.RemoteControl.RemoteControlGenerator.System.MissingMethodException: Method not found: 'Microsoft.CodeAnalysis.Compilation Uno.SourceGeneration.SourceGeneratorContext.get_Compilation()'.

I'm not sure where to look next. Any pointers? I would really like to continue using Refit with my REST API.

Thanks G


Solution

  • Refit 5.0 is not compatible with Uno.SourceGeneration 2.0 (used by Uno), as it loads up a Roslyn version that is different from the one used used by the Uno source generators during the build.

    This is the reason you're seeing this error of method not found.

    There are multiple ways to fix this (e.g. AppDomainIsolatedTask), but it cannot be done on the user's side.