Lesson 25. Consuming C# from F#

In the real world, you’ll be hard-pressed to write a purely F# application. Not only are most of the NuGet packages out there written in C#, but the entire BCL is too. You’ve been working with C# types and objects from F# and so you know how to deal with the basics already, but a few extra areas are worth touching upon in order to round off this subject. We’ll look at these topics:

  • Creating hybrid solutions
  • Using Visual Studio tools
  • Consuming assemblies from scripts
  • Consuming classes and interfaces in F#
  • Safely working with nullable objects in F#

25.1. Referencing C# code in F#

In addition to working with the BCL code base, virtually any C# code you write today can be consumed from F#. This includes the following: ...

Get Get Programming with F#: A guide for .NET developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.