I'd like to find a working example of using C# to CompileAssemblyFromSource of F# code. In my current attempts, I'm unable to create the compiler, getting an exception of "NotSupportedException", message of "Compilation not supported." My guess is I'm just doing it wrong, since F# Interactive works and has to be doing something similar, but correctly.
// C#
var source = "let add x y = x + y";
var cleanProvider = new FSharp.Compiler.CodeDom.FSharpCleanCodeProvider();
var compilerParams = new System.CodeDom.Compiler.CompilerParameters();
const string outfile = "C:\\temp\\FSFoo.EXE";
compilerParams.OutputAssembly = outfile;
compilerParams.GenerateExecutable = true;
var compiler = cleanProvider.CreateCompiler();
var compilerResults = compiler.CompileAssemblyFromSource(compilerParams, source);
var results = cleanProvider.CompileAssemblyFromSource(compilerParams, source);