By default the F# compiler will cross-module optimize code, and I'm seeing that it ends up inlining manyChars into the client assembly. manyChars constructs a ManyChars class from FParsecCS. This is an internal class, but InternalsVisibleTo allows FParsec to do so. But, if that call is inlined into the client assembly, a method access violation occurs:
Unhandled Exception: System.MethodAccessException: Attempt by method '<StartupCode$ftest>.$Program.main@()' to access method 'FParsec.ManyChars
at <StartupCode$ftest>.$Program.main@() in C:\Projects\ftest\Program.fs:line 2
Repro: open FParsec (manyChars anyChar) |> ignore
By adding --nooptimizationdata to the FParsec build options, this bug goes away.