使用 Uno Platform 的 Refit 5.0 失败并显示 "MissingMethodException"

Refit 5.0 with Uno Platform fails with "MissingMethodException"

我让它与 UWP 应用程序完美配合,但是当我尝试 运行 Droid 版本时,我收到以下错误:-

错误生成失败:System.AggregateException:发生了一个或多个错误。 ---> System.InvalidOperationException:Uno.UI.SourceGenerators.RemoteControl.RemoteControlGenerator.System.MissingMethodException 的生成失败:找不到方法:'Microsoft.CodeAnalysis.Compilation Uno.SourceGeneration.SourceGeneratorContext.get_Compilation()'。

我不确定下一步该看哪里。任何指针?我真的很想继续在我的 REST 中使用 Refit API。

谢谢 G

Refit 5.0 与 Uno.SourceGeneration 2.0(由 Uno 使用)不兼容,因为它加载的 Roslyn 版本与 Uno 源代码生成器在构建期间使用的版本不同。

这就是您看到此错误方法未找到的原因。

有多种方法可以解决此问题(例如 AppDomainIsolatedTask),但无法在用户端完成。