This is a baseline example of using Orleans with F#.
- FSharp : 9
- .NET : 9.0
- Orleans : 9.1.2
At the moment, four fixes are needed. All of them are marked with 'FSHARPFIX' comment in this project.
-
Host project either needs to be in C#, or you need to create a C# class with the following attribute
[assembly: GenerateCodeForDeclaringAssembly(typeof(TYPE_FROM_F#_PROJECT_WITH_GRAINS))]
-
In your F# Host project, you need a module that will expose assemblies to the Orleans runtime
-
Grains project needs to expose internal members to code gen project. Add the following
open System.Runtime.CompilerServices [<assembly: InternalsVisibleTo("C#_PROJECT_WITH_CODEGEN_CLASS")>] do()
-
For each F# type, you need an explicit attribute that will instruct Orleans to generate code for it
[<GenerateSerializer>]