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

.NET Core SDK preview1

Enrico Sada edited this page Nov 15, 2016 · 4 revisions

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

Download binaries/installers for all os from https://www.microsoft.com/net/download#core

F# works after install, without workarounds on all supported os.

To check version, you can run

dotnet --version

and the output should be 1.0.0-preview1-002702

An quickstart, to create a console app and run it with arguments ( "hello" etc ):

dotnet new --lang f#
dotnet restore
dotnet run -- hello from dotnet core

Known issues

None specific to F#, works ootb on all supported os (win, osx 10.11, ubuntu 14.04, docker).

Notes

The released preview1 version works OOTB but it's better to apply the following changes to avoid issues when a new .NET SDK version is released.

The next preview2 should not have the same problems.

1. Fix nugets feeds of Nuget.config

the Nuget.config contains a development feed who should be removed.

The expected Nuget.config (placed in same directory of project.json) is:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="fsharp-daily" value="https://www.myget.org/F/fsharp-daily/api/v3/index.json" />
  </packageSources>
</configuration>

2. Pin to a compatible version of dotnet-compile-fsc

The dotnet-compile-fsc is the integration between .NET SDK (dotnet cli) and f# compiler (fsc), so must be compatible with both.

The preferred way (atm for preview versions), is to use to a specific version 1.0.0-preview1-* so only versions compatible with preview1 are considered during dotnet restore

The project.json should be changed from

    "dotnet-compile-fsc": {
      "version": "1.0.0-*",

To

    "dotnet-compile-fsc": {
      "version": "1.0.0-preview1-*",

3. Use latest release FSharp.Core compatibile with preview1

The FSharp.Core assembly (build for .NET Core) is in the Microsoft.FSharp.Core.netcore nuget package. Atm the package is not released in http://nuget.org but it's in the myget development nuget feed fsharp-daily (see point 1.)

Until a version is published on nuget.org by VisualFSharp team, use the latest stable known version 1.0.0-alpha-160509

So change the project.json from:

    "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160316",

to:

    "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160509",

Or use 1.0.0-alpha-* if you want to use always the latest avaiable.