You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a plug-in contract using an async method that just returns a Task, I get this exception when trying to call the plug-in through Prise:
System.Text.Json.JsonException: 'A possible object cycle was detected which is not supported. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 0.'
It's quite easy is to replicate:
public interface IMyPlugin
{
public Task TestAsync();
}
[Plugin(PluginType = typeof(IMyPlugin))]
public class MyPlugin: IMyPlugin
{
public async Task TestAsync()
{
await Task.Run(() => Console.WriteLine("Inside of plug-in.")).ConfigureAwait(false);
}
}
On the host side, just call:
await plugin.TestAsync().ConfigureAwait(false);
and you get the exception above.
If you change the return to Task<string> or something else, it seems to work fine.
The text was updated successfully, but these errors were encountered:
Returning a void (like an untyped Task) is not supported at the moment, the Prise.Proxy library needs updating in order to fix this.
Expect this to be fixed in the next release (.NET 5)
When creating a plug-in contract using an async method that just returns a Task, I get this exception when trying to call the plug-in through Prise:
It's quite easy is to replicate:
On the host side, just call:
and you get the exception above.
If you change the return to
Task<string>
or something else, it seems to work fine.The text was updated successfully, but these errors were encountered: