Our journey to F#: C#-F# Interop – planetgeek.ch
CRANK

When we started with TimeRocket in 2015, we used C# as the programming language for our backend. In 2020, we started using F# for our new code. We see little value in rewriting existing C# code to F# and do so only when major changes are due in existing C# code. As a result, we have quite a bit of C#-F# interop in our system. Both from C# to F# and from F# to C#. This post overviews what we learned about C#-F# interop.This blog post is part of the F# Advent Calendar 2022 – check out the other blog posts!Mixing C# and F# in the same solutionYou can mix C# and F# code in the same solution, but for each assembly/project, you have to decide whether it’s a C# or F# assembly. The (simplified) architecture of our backend system looks like this:The ASP.NET controllers are distributed in several assemblies and referenced by a central assembly that holds the StartUp and Program classes. Referencing other assemblies containing controllers is enough for ASP.NET to find them. These assemblies ca…

planetgeek.ch
Related Topics: C# F#