views:

121

answers:

3

I have a program written c# that references an assembly written in F#. If I want to distribute it, I need to include the FSharp.Core.dll assembly right? (Assuming the user didn't install F# already)

Problem is, Visual Studio doesn't copy this dll (or any other related F# dlls) when I build my solution. How can I instruct it to copy the dll to the output folder?

Update: I'm currently just manually copying over the dlls for deployment. I was just wondering why this is needed at all.

+2  A: 

I don't know how to automate the distribution of FSharp.Core.dll, but you could try compiling with the --standalone flag to generate an assembly that runs on a PC without F# installed.

Compiler flags from MSDN.

cfern
I think this works for stand-alone programs. Looks like that may not work for me since my code is in a library which is called from a C# program. And that program needs to reference F# data types to inter-operate with it.
HS
+5  A: 

In VS, if you right-click on the assembly reference to FSharp.Core in the C# project, select "properties", and change "Copy Local" to "True", then FSharp.Core.dll will be copied to the output directory.

(This is generally true for any DLL that's installed in the GAC on your development machine but which is not installed on the deployment machine.)

Brian
Got it. I see that this works for libraries. However, ASP.NET apps have a different way of showing References and this doesn't seem to work there.
HS
+1  A: 

With .net 4.0 there is an F# Runtime distribution. F# Runtime This is like the J# Runtime that used to ship separately.

Steve