Deploying F# exe - f#

I have an F# program I built in VS2013. I am intending to deploy this on a windows 2008 R2 server with .NET framework 4.5 installed. Now, when I build the program in visual studio, it creates an exe in the debug/bin directory (MyProgram.exe). Do I need to include a copy of fharp.core.dll with the exe? Or, will the build process automatically compile the necessary dependancy DLLs (fsharp.core, fsharp.data, fsharp.data.TypeProviders)? Most of the research I can search online for seems to look at VS2010 and I am not using fsc,exe currently.
Thanks for any insight provided.

You can use the compiler option --standalone to statically links the FSharp.Core.dll (F# runtime) and any reference assemblies that depend on it (i.e. any other F# assemblies).

You may or may not need to copy FSharp.Core.dll together with the .exe.
If F# is already installed on the server, you may not need it, but it has to be the correct version of F#.
Otherwise, the F# license allows you to deploy FSharp.Core.dll together with your own binaries.
There's also the 'official' FSharp.Core NuGet package, if that's more to your liking.

Related

Crystal Reports in Visual Studio 2017

I have a MVC .Net application that uses a Crystal Report to return a PDF file. It was working ok, but I wanted to install the most recent version of the runtime on the server to see if it would correct an issue with fonts that I was experiencing.
The server is Windows Server 2008 R2, and I installed the most recent version of CR for VS from the SAP website. This installed two things on the server: SAP Crystal Reports runtime engine for .NET Framework (64-bit) 13.0.21.2533, and SAP Crystal Reports, version for Visual Studio 13.0.21.2533.
My Visual Studio project has the following Nuget packages installed: CrystalDecisions.CrystalReports.Engine, CrystalDecisions.Shared, CrystalDecisions.ReportSource, CrystalDecisions.Web.
Now when I try to access this page and generate the PDF, I get the following server error:
Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
I'm not finding any coherent info online as to why this error is appearing or how to resolve it aside from copying DLLs to the bin folder. I tried adding a couple of Nuget packages relating to CrystalDecisions.ReportAppServer. There is not a Copy Local option for the DLL reference, so I tried to manually copy the DLL from the Nuget packages folder for the project and paste them into the bin folder, but that didn't lead anywhere except more errors that I couldn't resolve.
The documentation on this stuff is horrible and confusing, when it seems like it should be pretty straightforward, as I said this was already working before I upgraded the runtime and CR for VS.
Are the Nuget packages maybe not compatible with this newer version? On this SAP blog post, it mentions "As most of CR/RAS .NET Assemblies are now re-versioned from 13.0.2000.0 to 13.0.3500.0, user MUST remove all old CR assemblies from Reference list and add the new version of CR assemblies, then rebuild the application.", but I do not know where to get these assemblies aside from using the Nuget packages.
Please download all the packages of crystal reports 13.0.21. You have to download all packages are given below.
CrystalDecisions-CrystalReports-Engine
CrystalDecisions-ReportSource
CrystalDecisions-Shared
CrystalDecisions-Web
CrystalDecisions-ReportAppServer

Can't load nuget package written with .NET Core

I have recently attempted to migrate my open source project GeographicLib.FSharp (https://github.com/SpiegelSoft/GeographicLib) to .NET Standard. I can build the project, package it and upload it to nuget, but when I try to load the nuget package into an external .NET Standard Library, I obtain mixed results.
Creating an F# library using dotnet new classlib -lang f# and adding the Nuget package via Visual Studio works on the face of it, but I cannot access any of the types I defined in the GeographicLib.FSharp library.
If I create a C# .NET Standard library using the Class Library (.NET Standard) template, then upgrade this package to .NET Standard 1.6, I can add the GeographicLib.FSharp nuget package and access the types as normal.
It appears that importing types from Nuget packages in F# .NET Standard Libraries is broken.
Is there a fix or a workaround for this?
Visual Studio F# extension doesn't yet support .NET Standard or .NET Core projects.
See https://blogs.msdn.microsoft.com/dotnet/2017/08/14/f-and-net-core-roadmap-update/ for more info and roadmap
If you think is an issue, please open a bug in Visual F# repository https://github.com/Microsoft/visualfsharp/issues
These project build, but doesnt load intellisense in Visual Studio.
Meanwhile you can use other ide/editors, like:
Visual Studio Code with Ionide extension
JetBrains Rider
vim
emacs
Visual Studio for Mac

Automatic building and installing Delphi components

So, my Delphi component is functional and working, aside few details yet to cover. What I would like is to create a setup (Inno setup) that would automatically install my component into user's Delphi/C++ Builder IDE. I presume I must use delphi command line compiler, but how?
Thank you.
Unfortunately Delphi IDE does not support automated component installation at all. IMO, that is very big problem since component architecture is so important in Delphi.
You can build your package from command line (using MSBuild or DCC) but you cannot install it to IDE. To install your package you should write your own installer that builds you package, copies compiled files and updates Windows registry. Note there is no official documentation how to write such an installer, but you can take Jedi (JVCL) installer code as an example.
There are also 3rd party tools that automate component installation, for example 'lazy builder', that may be interesting to you.
It's not too hard, just messy. You need to compile a BPL for each Delphi version that you want to target and then your installer puts this BPL into a folder of your choosing (often users,public etc). This folder location is then written as a registry key under the relevant Delphi Installed Packages node. Lo when you run Delphi your components appear as if you had used the manual install packages option.

Is there a way to install F# 3.0 without Visual Studio?

I was hoping to upgrade to F# 3.0 but I can't find either a packaged F# 3.0 compiler on Microsoft site, nor if there is an express version to use. Is it possible to install F# 3.0 for use from the command line or a simple IDE and if so, how?
The standalone version of F# is not available yet, but F# tools for Visual Studio Express have been released just 2 days ago, so you can get F# 3.0 for free.
Announcing F# Tools for Visual Studio Express 2012 for Web!
As far as I know, there are definitely plans for open-source release (that can be integrated with MonoDevelop) and it would make sense to have a stand-alone installer too (otherwise you could still just compile the open-source release), but I don't think there are specific dates for that.
The easiest way I've got it to run:
http://www.heartysoft.com/build-fsharp-3-on-build-server-without-vs
Essentially using the direct download link on the Web PI tools.
I have successfully make a standalone F# 3.0 works without Visual Studio 2012.
First, find a workstation with F# 3.0 installed. (source)
Duplicate all the things to destination workstation.
-> C:\Program Files (x86)\Microsoft SDKs\F#
-> C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp
-> C:\Windows\Microsoft.NET\assembly\GAC_MSIL\FSharp*
Install .NET 4.5 at destination.
Export all the registry item with FSC.exe string to destination.
Export all the registry item with FSharp string to destination.
f# 3.0 registry.rar
if you don't know how to export the registry items, please download this file and use powershell to import all this .reg file.
PowerShell script: (put the .reg files into c:\xxx suppossedly )
cd c:\xxx
dir *.reg | %{ ('reg import "' + $_.Name + '"') | cmd }
I'm assuming most of you seeking an answer to this question by now probably wouldn't mind the most recent version, which is 4.0. You can download this as a standalone at F# 4.0 . This does not include the supporting assemblies and will fail by itself. So you'll also have to download and install the Microsoft Build Tools 2015 . Should be all set to go from there, no installing the mega-massive visual studio. Of course if you need an IDE you'll need to seek out a free one.
You can use Nuget CLI to install the F# Compiler Tools without relying on Visual Studio. As a plus, this procedure does not require admin rights.
Visit nuget.org/downloads and download the latest nuget.exe file.
Instruct your browser to save the file to a folder of your choice.
Add the folder where you placed nuget.exe to your PATH environment variable to use the CLI tool from anywhere.
Open a command prompt and navigate to the folder where you want to install F# Tools.
Run "nuget install FSharp.Compiler.Tools -Version {version}", where {version} is replaced with a version from https://www.nuget.org/packages/FSharp.Compiler.Tools
Add the 'tools' directory to your PATH Environment Variable and then you will be able to use fsc and fsi from the command line.
There is not currently a standalone version of F# 3.0. However, one has been promised
I run F# 3.0 from the cygwin command line on Windows 7. You need to know a little about Linux/Unix to use cygwin, but the basics are not too difficult. You need the basic cygwin shell (command interpreter) and an editor. I am used to vi, so cygwin has vim (there exists a nice F# syntax color addon to vim).
You need to:
Install visual studio in order to get F#
in /users/myname/.bashrc add the location of Fsc.exe, which in my case is
/cygdrive/c/Program Files (x86)/Microsoft SDKs/F#/3.0/Framework/v4.0
to your PATH.

Packaging F# program for Mono

I am currently learning F# and preparing to write my first program. I will be using Visual Studio 10 in Windows 7 to write the code, because the F# support for MonoDevelop is a few versions behind.
My normal day-to-day development environment is Mac Os X 10.7. I have Mono and MonoDevelop installed. After I finish writing my masterpiece, how do I package it for running on Os X? What DLLs do I need to send to other Windows users so that they can run my .exe file? How do they install those DLLs?
In the Java world (where I usually live), I just package my Java code with any dependencies into a monolithic UberJAR that I can send to anyone who has the appropriate version of Java (usually 6) and they can run my code by typing
java -jar MyUberJar.jar
I routinely write code in Scala and include the Scala library, along with any other dependencies.
Is there any easy way to do something similar for .NET, and specifically for F#?
One alternative is to use the --standalone flag to fsc which will statically compile all the DLL's you need into a single large EXE. The people you send it to will still need to install Mono, but there are no other dependencies.
I think this is what most people use:
http://wix.sourceforge.net/
I say "I think" because at work we've got a release team that builds the installer package for us.

Resources