Open fwaris opened 1 year ago
Update: I set <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
in the C# host project and found that there are 'generated' files for Dashboard grain serialization.
No source is generated for F# so maybe that's the reason for the error. However, not sure what is the solution other than maybe support for F# code generation.
After a little more digging, I found that adding parts of C# generated code - namely assembly attributes - to F# host, fixed this issue. 'Program.fs' is now as follows:
open Microsoft.Extensions.Hosting
open Orleans
open Orleans.Hosting
Host.CreateDefaultBuilder()
.UseOrleans(fun siloBuilder ->
siloBuilder
.UseDashboard()
.UseLocalhostClustering()
.AddMemoryGrainStorage("store") |> ignore)
.RunConsoleAsync()
|> Async.AwaitTask
|> Async.RunSynchronously
module Load =
//[<assembly: Orleans.ApplicationPartAttribute("SiloCS")>]
[<assembly: Orleans.ApplicationPartAttribute("GrainsCodeGen")>]
[<assembly: Orleans.ApplicationPartAttribute("Orleans.Core.Abstractions")>]
[<assembly: Orleans.ApplicationPartAttribute("Orleans.Serialization")>]
[<assembly: Orleans.ApplicationPartAttribute("Orleans.Core")>]
[<assembly: Orleans.ApplicationPartAttribute("Orleans.Persistence.Memory")>]
[<assembly: Orleans.ApplicationPartAttribute("Orleans.Runtime")>]
[<assembly: Orleans.ApplicationPartAttribute("Orleans.Reminders")>]
[<assembly: Orleans.ApplicationPartAttribute("OrleansDashboard.Core")>]
[<assembly: Orleans.ApplicationPartAttribute("OrleansDashboard")>]
//[<assembly: global::Orleans.Serialization.Configuration.TypeManifestProviderAttribute(typeof(OrleansCodeGen.SiloCS.Metadata_SiloCS))]
()
I will use this as a workaround while waiting for the 'official' fix or recommendation.
Also not sure what the TypeManifestProvider
attribute does and will a lack of it cause issues later on?
linking reminders issue #8125. The workaround solution will likely work for the reminder table issue also
Thanks legend. Nice one for this
Unable to host silo in F# console project. C# console project works fine. Please see attached minimal repo.
FsGrains (2).zip
Need to host in F# due to other F# frameworks (e.g. for web dev) required for the application.
Issue is with the 7.x version. This was not an issue with the 3.x.x version of Orleans.
F# hosting works if 'UseDashboard' is commented out.
Error seen: