orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Generator 'OrleansSerializationSourceGenerator' failed to generate source, 4.0.0-preview2

Open COCPORN opened this issue 1 year ago • 0 comments

I think I've managed to upgrade relatively well to preview2, but I am getting this error message still: CS8785 Generator 'OrleansSerializationSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.TypeParameterSymbol' to type 'Microsoft.CodeAnalysis.INamedTypeSymbol'.' .

This manifests for me as Orleans picking up the grain interfaces, but not their implementation, it seems. I think they are related.

It logs like this at runtime, which is similar to what I assume the error message would be if the implementation was just missing:

System.ArgumentException: Could not find an implementation for interface HelloWorld.IHelloWorldService
   at Orleans.GrainInterfaceTypeToGrainTypeResolver.GetGrainType(GrainInterfaceType interfaceType) in /_/src/Orleans.Core/Core/GrainInterfaceTypeToGrainTypeResolver.cs:line 149
   at Orleans.GrainFactory.GetGrain(Type interfaceType, IdSpan grainKey, String grainClassNamePrefix) in /_/src/Orleans.Core/Core/GrainFactory.cs:line 214
   at Orleans.GrainFactory.GetGrain(Type grainInterfaceType, Int64 key) in /_/src/Orleans.Core/Core/GrainFactory.cs:line 162
   at Orleans.Runtime.InternalClusterClient.GetGrain(Type grainInterfaceType, Int64 grainPrimaryKey) in /_/src/Orleans.Runtime/Core/InternalClusterClient.cs:line 129

It seems to me to start occurring with preview2 as the same (or at least similar code) worked fine with preview1, but I am not 100% sure exactly when it started happening.

Also, this could obviously be related to me not correctly doing the upgrade from preview1 to preview2.

COCPORN avatar Aug 10 '22 06:08 COCPORN