Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

.NET Core SDK 1.0

Enrico Sada edited this page Jun 13, 2017 · 2 revisions

Links for installation:

The sdk binaries/installer include both .NET Core runtimes branches, the LTS 1.0.5 and the Current 1.1.2

NOTE you need the sdk. The runtime binaries/installer doesnt include the sdk, so cannot be used to build projects, just to run already built projects.

Use the simpler instructions but add -lang f# to dotnet new

The Announcement msdn blog post

F# works after install in all OS supported by .NET Core runtime 1.0

It doesnt works (for development as sdk, is ok to target these os as for deploy) on OS supported by .NET Core runtime 1.1 only like Ubuntu 16.10, openSUSE 42.1, Fedora 24 (ref dotnet/netcorecli-fsc#91 issue), see Known issue for partial workaround.

To check version, you can run

dotnet --version

and the output should be 1.0.4

An quickstart, to create a console app and run it:

dotnet new console -lang f#
dotnet restore
dotnet run

To run an ASP.NET Core app, is the same, just use another template

dotnet new mvc -lang f#
dotnet restore
dotnet run

You can do dotnet new -all -lang f# to show all f# templates (plus common)

To use Visual Studio Code using Ionide, with full intellisense and debug, require the project to be restored (dotnet restore)

dotnet new lib -lang f#
dotnet restore
code .

Notes

To help in converting from project.json to msbuild based .fsproj, usually dotnet migrate is enough, but has some issues with f#, see below for workaround.

Also good this post for information about the equivalent options in each format.

Versions

Each version is a patch version and can be safely upgraded

1.0.4

The version 1.0.4 (released on 2017-05-09) works correctly

Changes:

1.0.1

The version 1.0.1 (release on 2017-03-07 )) works correctly

Wiki page 1.0.1 for more info, like changes from 1.0.0-rc4

Known issues

using .NET Framework as targets framework, the osx/unix build fails

Use a .net framwork (not core) like <TargetFramework>net451</TargetFramework> (or in TargetFrameworks) the dotnet build/pack fails on osx/unix, instead on windows work

  • ISSUE: https://github.com/dotnet/sdk/issues/335

  • WORKAROUND: see issue, if applicable

  • WORKAROUND (with mono installed): set FrameworkPathOverride environment variable to use .net framework assemblies installed by mono

    Find where .../mono/4.5/mscorlib.dll is on your machine and set FrameworkPathOverride as an environment variable

    • Easiest if mono is already on your path

      export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/
      
    • OSX (assuming mono install with xamarin studio):

      export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/4.6.2/lib/mono/4.5/
      
    • OSX (assuming mono installed with brew):

      export FrameworkPathOverride=/usr/local/Cellar/mono/4.6.2.16/lib/mono/4.5/
      
    • Debian:

      export FrameworkPathOverride=/usr/lib/mono/4.5/
      

    You can then build by specifying the target framework and runtime identifier (run will not work):

    dotnet build -f net462 --runtime osx.10.11-x64
    

    To know the runtime id, just do dotnet --info Or you can set the RuntimeIdentifier environment variable like so:

    export RuntimeIdentifier=$(dotnet --info | grep "RID" | awk '{print $2}')
    

cannot produce full pdb

Using <DebugType>full</DebugType> doesnt produce full pdb. no error/warning and no pdb is created. fsc built for .net core doesnt support that scenario, ref https://github.com/Microsoft/visualfsharp/issues/2565

.NET Core 1.1.1 for Ubuntu 16.10 fails to build F# projects

Use the .NET Core 1.0.4 download for Ubuntu 16.04 instead (works on Ubuntu 16.10). ref dotnet/netcorecli-fsc#91 issue

dotnet-migrate

dotnet migrate doesnt support F# yet:

IDE Support

  • VS Code with F# Ionide ( version >= 2.25.1 ) extension: ok (build/run/intellisense,debug)
    • NOTE: the VSCode require a dotnet restore
  • vim: yes
  • emacs: yes
  • VS On Mac: yes
  • VS 2017: no
  • Notepad and cli: from day 0 all dotnet sdk commands, ok (new,restore/build/run/pack/publish/test), ko (migrate)