I compiled CoreCLR and CoreFX as described here . This basically works, and I can compile and run the Coreclr oriented C # code.
The next step was to try compiling and running the F # code. So I added FSharp.Core 3.1.2.1 to the project and compiled an example application using the following command:
fsc ^ --noframework ^ --targetprofile:netcore ^ /r:packages\System.Runtime.4.0.20-beta-22703\lib\contract\System.Runtime.dll ^ /r:packages\System.Reflection.4.0.10-beta-22703\lib\contract\System.Reflection.dll ^ /r:packages\System.Collections.4.0.10-beta-22703\lib\contract\System.Collections.dll ^ /r:packages\System.Diagnostics.Debug.4.0.10-beta-22703\lib\contract\System.Diagnostics.Debug.dll ^ /r:packages\System.IO.FileSystem.4.0.0-beta-22703\lib\contract\System.IO.FileSystem.dll ^ /r:packages\System.Linq.Expressions.4.0.10-beta-22703\lib\contract\System.Linq.Expressions.dll ^ /r:packages\System.Console.4.0.0-beta-22703\lib\contract\System.Console.dll ^ /r:packages\System.Runtime.Extensions.4.0.10-beta-22703\lib\contract\System.Runtime.Extensions.dll ^ /r:packages\System.Runtime.InteropServices.4.0.20-beta-22703\lib\contract\System.Runtime.InteropServices.dll ^ /r:packages\System.Text.Encoding.4.0.10-beta-22703\lib\contract\System.Text.Encoding.dll ^ /r:packages\System.Text.RegularExpressions.4.0.10-beta-22703\lib\contract\System.Text.RegularExpressions.dll ^ /r:packages\System.Threading.Overlapped.4.0.0-beta-22703\lib\contract\System.Threading.Overlapped.dll ^ /r:packages\System.Threading.ThreadPool.4.0.10-beta-22703\lib\contract\System.Threading.ThreadPool.dll ^ /r:packages\FSharp.Core.3.1.2.1\lib\portable-net45+netcore45+MonoAndroid1+MonoTouch1\FSharp.Core.dll ^ /out:runtime\HelloWorld.exe HelloWorld.fs
As you can see, I built against Profile7 in FSharp.Core. When I run the application, the let test = sprintf "Hello, world" statement let test = sprintf "Hello, world" fails with the following exception:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified. at Microsoft.FSharp.Core.PrintfImpl.PrintfBuilderStack..ctor() at Microsoft.FSharp.Core.PrintfImpl.PrintfBuilder`3..ctor() at Microsoft.FSharp.Core.PrintfImpl.Cache`4.generate(String fmt) at Microsoft.FSharp.Core.PrintfImpl.f@4277-43[T,TState,TResidue,TResult](String key, Unit unitVar0) at Microsoft.FSharp.Core.PrintfImpl.Cache`4.get(String key) at Microsoft.FSharp.Core.PrintfImpl.Cache`4.Get(PrintfFormat`4 key) at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThen[TResult,T](FSharpFunc`2 continutation, PrintfFormat`4 format) at HelloWorld.main(String[] args)
I also discussed this one here , but I could not understand what I was doing wrong. Am I including the wrong version of FSharp.Core? Profile7 should work .
c # f # coreclr
Johannes Egger
source share