After upgrading from Orleans 9.x to 10.x and following the migration path specified in https://learn.microsoft.com/en-us/dotnet/orleans/migration-guide?pivots=orleans-10-0 I get the following error:
Unable to resolve service for type 'System.String' while attempting to activate 'OrleansCodeGen.My.Lib.Activator_MyType`1[My.Lib.SimpleRecord]'.
If I migrate from [OrleansConstructor] to [ActivatorUtilitiesConstructor] instead of [GeneratedActivatorConstructor] it works just fine.
namespace My.Lib;
[GenerateSerializer]
public class MyType<T>
{
public MyType(OtherType original)
{
// ...
}
// tested attributes
// [OrleansConstructor] // obsolete, but works
// [GeneratedActivatorConstructor] // the migration path as specified in docs, but gives error
// [ActivatorUtilitiesConstructor] // workaround - solves the issue.
[GeneratedActivatorConstructor]
public MyType(string a, string b, T? c)
{
// ...
}
[Id(0)]
public string A { get; }
[Id(1)]
public string? B { get; }
[Id(2)]
public T? C { get; set; }
}
Either the generator doesn't work as expected or the docs are wrong.
After upgrading from Orleans 9.x to 10.x and following the migration path specified in https://learn.microsoft.com/en-us/dotnet/orleans/migration-guide?pivots=orleans-10-0 I get the following error:
If I migrate from
[OrleansConstructor]to[ActivatorUtilitiesConstructor]instead of[GeneratedActivatorConstructor]it works just fine.Either the generator doesn't work as expected or the docs are wrong.