I created a .Net core 2.1 F# console application in Visual Studio 2017 on Windows. I would try the code in F# Interactive window. However, right-clicking the Dependencies
will not show the command of sending the reference to F# Interactive window. Expanding the NuGet tree can find the DLL file names but they don't have the full path so I cannot manually run #r ".../full path/Akka.FSharp.dll";;
.
The code of the testing .Net core application.
open System
open Akka.FSharp
let system = System.create "MovieStreamingActorSystem" <| Configuration.load ()
type ProcessorMessage = ProcessJob of int * int * string
let processor (mailbox: Actor<ProcessorMessage>) =
let rec loop () = actor {
let! m = mailbox.Receive ()
printfn "Message %A" m
return! loop ()
}
loop ()
[<EntryPoint>]
let main argv =
let processorRef = spawn system "processor" processor
processorRef <! ProcessJob(1, 2, "3")
0
To add files to tfs: from command line, go to the directory containing assemblies and type "tf add foo. dll" OR in Source Control Explorer, go to the location where the assemblies should be and click "Add to Source Control" on the toolbar or from File->Source Control.
Any DLL that lays somewhere in file system can be referenced. After compilation this DLL must be either in GAC (Global Assembly Cache) or in same directory with the working application.
You cannot do this at this time as F# Interactive doesn't support .net core. 🙃 However as the API surface is almost identical to .net 4.7 and you can nuget necessary packages just reference it directly, just get whatever dlls are necessary directly and use #r
:
#if INTERACTIVE
#r "System.IO.Compression.FileSystem.dll"
#endif
For example this will let you use some extension methods for zip archives by pulling in the compression dll from .net.
The .net core dlls will be packaged up in the publish
folder, if you decide to create a framework independent pacakage. Whatever full framework dlls you would need for fsharp interactive just pull them down directly or to another project.
By the way, if you wonder where the .net core nuget packages get pulled down, it's in:
C:\Users\$USERNAME\.nuget\packages
. You should find net45 and netstandard2 versions when supported.
Update: In VS2019 preview F# Interactive is dotnetcore, and it's possible to reference dotnetstandard dlls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With