Get compilation symbols from Unity scripts

I’m trying to write a plugin with F#. I already know how to add references to UnityEngine.dll so that I have symbols for Unity classes, but how can I add references to the classes defined in C# scripts I write (so I can make instances of those classes in F#)?

I’ve figured it out:

  • Open the Assembly-CSharp project with VS (you can just double click on the scripts in the inspector if VS is your default .cs editor.
  • Build the Assembly-CSharp project.
  • Add a F# project under the solution (it should be auto-generated by VS), add reference to the Assembly-CSharp project.
  • Profit.