Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions docs/fsharp/get-started/get-started-command-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ This article covers how you can get started with F# on any operating system (Win

## Prerequisites

To begin, you must install the [.NET Core SDK 1.0 or later](https://www.microsoft.com/net/download/). There is no need to uninstall a previous version of the .NET Core SDK, as it supports side-by-side installations.
To begin, you must install the latest [.NET Core SDK](https://www.microsoft.com/net/download/).

This article assumes that you know how to use a command line and have a preferred text editor. If you don't already use it, [Visual Studio Code](https://code.visualstudio.com) is a great option as a text editor for F#. To get awesome features like IntelliSense, better syntax highlighting, and more, you can download the [Ionide Extension](https://marketplace.visualstudio.com/items?itemName=Ionide.Ionide-fsharp).
This article assumes that you know how to use a command line and have a preferred text editor. If you don't already use it, [Visual Studio Code](get-started-vscode.md) is a great option as a text editor for F#.

## Build a simple multi-project solution

Open a command prompt/terminal and use the [dotnet new](../../core/tools/dotnet-new.md) command to create new solution file called `FSNetCore`:

```
```console
dotnet new sln -o FSNetCore
```

The following directory structure is produced after running the previous command:

```
```console
FSNetCore
├── FSNetCore.sln
```
Expand All @@ -34,13 +34,13 @@ Change directories to *FSNetCore*.

Use the `dotnet new` command, create a class library project in the **src** folder named Library.

```
```console
dotnet new lib -lang F# -o src/Library
```

The following directory structure is produced after running the previous command:

```
```console
└── FSNetCore
├── FSNetCore.sln
└── src
Expand All @@ -62,29 +62,29 @@ let getJsonNetJson value =

Add the Newtonsoft.Json NuGet package to the Library project.

```
```console
dotnet add src/Library/Library.fsproj package Newtonsoft.Json
```

Add the `Library` project to the `FSNetCore` solution using the [dotnet sln add](../../core/tools/dotnet-sln.md) command:

```
```console
dotnet sln add src/Library/Library.fsproj
```

Restore the NuGet dependencies using the `dotnet restore` command ([see note](#dotnet-restore-note)) and run `dotnet build` to build the project.
Run `dotnet build` to build the project. Unresolved dependencies will be restored when building.

### Write a console application that consumes the class library

Use the `dotnet new` command, create a console application in the **src** folder named App.

```
```console
dotnet new console -lang F# -o src/App
```

The following directory structure is produced after running the previous command:

```
```console
└── FSNetCore
├── FSNetCore.sln
└── src
Expand Down Expand Up @@ -115,33 +115,34 @@ let main argv =

Add a reference to the `Library` project using [dotnet add reference](../../core/tools/dotnet-add-reference.md).

```
```console
dotnet add src/App/App.fsproj reference src/Library/Library.fsproj
```

Add the `App` project to the `FSNetCore` solution using the `dotnet sln add` command:

```
```console
dotnet sln add src/App/App.fsproj
```

Restore the NuGet dependencies, `dotnet restore` ([see note](#dotnet-restore-note)) and run `dotnet build` to build the project.

Change directory to the `src/App` console project and run the project passing `Hello World` as arguments:

```
```console
cd src/App
dotnet run Hello World
```

You should see the following results:

```
```console
Nice command-line arguments! Here's what JSON.NET has to say about them:

I used to be Hello but now I'm ""Hello"" thanks to JSON.NET!
I used to be World but now I'm ""World"" thanks to JSON.NET!
```

<a name="dotnet-restore-note"></a>
[!INCLUDE[DotNet Restore Note](~/includes/dotnet-restore-note.md)]
## Next steps

Next, check out the [Tour of F#](../tour.md) to learn more about different F# features.
31 changes: 7 additions & 24 deletions docs/fsharp/get-started/get-started-visual-studio.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
---
title: Get started with F# in Visual Studio
description: Learn how to use F# with Visual Studio.
ms.date: 02/13/2017
ms.date: 07/03/2018
---
# Get started with F# in Visual Studio

F# and the Visual F# tooling are supported in the Visual Studio IDE. To begin, you should [download Visual Studio](https://aka.ms/vsdownload?utm_source=mscom&utm_campaign=msdocs), if you haven't already. This article uses the Visual Studio 2017 Community Edition, but you can use F# with the version of your choice.
F# and the Visual F# tooling are supported in the Visual Studio IDE.

## Installing F# #

If you're downloading Visual Studio for the first time, it will first install the Visual Studio installer. Install any version of Visual Studio 2017 from the installer. If you already have it installed, click **Modify**.

You'll next see a list of Workloads. You can install F# through any of the following workloads:

|Workload|Action|
|--------|------|
| .NET Core cross-platform development | No action - F# is installed by default |
| ASP.NET and web development | No action - F# is installed by default |
| Azure development | No action - F# is installed by default |
| Mobile development with .NET | No action - F# is installed by default |
| Data science and analytical applications | No action - F# is installed by default |
| .NET desktop development | Select **F# desktop language support** from the right-hand side |
| Data storage and processing | Select **F# desktop language support** from the right-hand side |

Next, click **Modify** in the lower right-hand side. This will install everything you have selected. You can then open Visual Studio 2017 with F# language support by clicking **Launch**.
To begin, ensure that you have [Visual Studio installed with F#](installing-fsharp.md#installing-f-with-visual-studio).

## Creating a console application

Expand Down Expand Up @@ -72,8 +56,7 @@ Congratulations! You've created your first F# project in Visual Studio, written
If you haven't already, check out the [Tour of F#](../tour.md), which covers some of the core features of the F# language. It will give you an overview of some of the capabilities of F#, and provide ample code samples that you can copy into Visual Studio and run. There are also some great external resources you can use, showcased in the [F# Guide](../index.md).

## See also
[Visual F#](index.md)
[Tour of F#](../tour.md)
[F# language reference](../language-reference/index.md)
[Type inference](../language-reference/type-inference.md)
[Symbol and operator reference](../language-reference/symbol-and-operator-reference/index.md)
[Tour of F#](../tour.md)
[F# language reference](../language-reference/index.md)
[Type inference](../language-reference/type-inference.md)
[Symbol and operator reference](../language-reference/symbol-and-operator-reference/index.md)
43 changes: 2 additions & 41 deletions docs/fsharp/get-started/get-started-vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,9 @@ ms.date: 05/28/2018
---
# Get Started with F# in Visual Studio Code

You can write F# in [Visual Studio Code](https://code.visualstudio.com) with the [Ionide plugin](https://marketplace.visualstudio.com/items?itemName=Ionide.Ionide-fsharp), to get a great cross-platform, lightweight Integrated Development Environment (IDE) experience with IntelliSense and basic code refactorings. Visit [Ionide.io](http://ionide.io) to learn more about the plugin suite.
You can write F# in [Visual Studio Code](https://code.visualstudio.com) with the [Ionide plugin](https://marketplace.visualstudio.com/items?itemName=Ionide.Ionide-fsharp) to get a great cross-platform, lightweight Integrated Development Environment (IDE) experience with IntelliSense and basic code refactorings. Visit [Ionide.io](http://ionide.io) to learn more about the plugin.

## Prerequisites

You must have [git installed](https://git-scm.com/download) and available on your PATH to make use of project templates in Ionide. You can verify that it is installed correctly by typing `git --version` at a command prompt and pressing **Enter**.

### [macOS](#tab/macos)

Ionide uses [Mono](http://www.mono-project.com). The easiest way to install Mono on macOS is via Homebrew. Simply type the following into your terminal:

```
brew install mono
```

You must also install the [.NET Core SDK](https://www.microsoft.com/net/download).

### [Linux](#tab/linux)

On Linux, Ionide also uses [Mono](https://www.mono-project.com). If you're on Debian or Ubuntu, you can use the following:

```
sudo apt-get update
sudo apt-get install mono-complete fsharp
```

You must also install the [.NET Core SDK](https://www.microsoft.com/net/download).

### [Windows](#tab/windows)

If you're on Windows, you must [install Visual Studio with F# support](get-started-visual-studio.md#installing-f). This installs all the necessary components to write, compile, and execute F# code.

You must also install the [.NET Core SDK](https://www.microsoft.com/net/download/).

---

## Installing Visual Studio Code and the Ionide plugin

You can install Visual Studio Code from the [code.visualstudio.com](https://code.visualstudio.com) website.

Next, click the Extensions icon and search for "Ionide":

The only plugin required for F# support in Visual Studio Code is [Ionide-fsharp](https://marketplace.visualstudio.com/items?itemName=Ionide.Ionide-fsharp). However, you can also install [Ionide-FAKE](https://marketplace.visualstudio.com/items?itemName=Ionide.Ionide-FAKE) to get [FAKE](https://fsharp.github.io/FAKE/) support and [Ionide-Paket](https://marketplace.visualstudio.com/items?itemName=Ionide.Ionide-Paket) to get [Paket](https://fsprojects.github.io/Paket/) support. FAKE and Paket are additional F# community tools for building projects and managing dependencies, respectively.
To begin, ensure that you have [F# and the Ionide plugin correctly installed](installing-fsharp.md#installing-f-with-visual-studio-code).

## Creating your first project with Ionide

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
---
title: Get started with F# in Visual Studio for Mac
description: Learn how to use F# with Visual Studio for Mac.
ms.date: 02/13/2017
ms.date: 07/03/2018
---
# Get started with F# in Visual Studio for Mac

F# and the Visual F# tooling are supported in the Visual Studio for Mac IDE. To begin, you should [download Visual Studio for Mac](https://aka.ms/vsdownload?utm_source=mscom&utm_campaign=msdocs), if you haven't already. This article uses the Visual Studio Community 2017 for Mac, but you can use F# with the version of your choice.

## Installing F# #

After downloading Visual Studio for Mac, it will prompt you to choose what you want to install. For the purposes of this article we will be leaving the defaults. In contrast to Visual Studio for Windows, you do not need to specifically install F# support. Press "Install" to proceed.

After the install completes, choose "Start Visual Studio". You can also launch it through Finder on macOS.
F# and the Visual F# tooling are supported in the Visual Studio for Mac IDE. Ensure that you have [Visual Studio for Mac installed](installing-fsharp.md#installing-f-with-visual-studio-for-mac).

## Creating a console application

Expand Down
62 changes: 62 additions & 0 deletions docs/fsharp/get-started/install-fsharp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: Install F#
description: Learn how to install F# based on your environment.
ms.date: 07/03/2018
---

# Install F# #

You can install F# in multiple ways, depending on your environment.

## Install F# with Visual Studio

If you're downloading [Visual Studio](https://visualstudio.microsoft.com/) for the first time, it will first install the Visual Studio installer. Install the appropriate SKU of Visual Studio from the installer. If you already have it installed, click **Modify**.

You'll next see a list of Workloads. Select **ASP.NET and web development**, which will install F# support, .NET Core support, and F# support for ASP.NET Core projects.

Next, click **Modify** in the lower right-hand side. This will install everything you have selected. You can then open Visual Studio 2017 with F# language support by clicking **Launch**.

## Install F# with Visual Studio for Mac

F# is installed by default in [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/), no matter what configuration you choose.

After the install completes, choose "Start Visual Studio". You can also launch it through Finder on macOS.

## Install F# with Visual Studio Code

You must have [git installed](https://git-scm.com/download) and available on your PATH to make use of project templates in Ionide. You can verify that it is installed correctly by typing `git --version` at a command prompt and pressing **Enter**.

### [macOS](#tab/macos)

Ionide uses [Mono](http://www.mono-project.com). The easiest way to install Mono on macOS is via Homebrew. Simply type the following into your terminal:

```console
brew install mono
```

You must also install the [.NET Core SDK](https://www.microsoft.com/net/download).

### [Linux](#tab/linux)

On Linux, Ionide also uses [Mono](https://www.mono-project.com). If you're on Debian or Ubuntu, you can use the following:

```console
sudo apt-get update
sudo apt-get install mono-complete fsharp
```

You must also install the [.NET Core SDK](https://www.microsoft.com/net/download).

### [Windows](#tab/windows)

If you're on Windows, you must [install Visual Studio with F# support](installing-fsharp.md#installing-f-with-visual-studio). This installs all the necessary components to write, compile, and execute F# code.

You must also install the [.NET Core SDK](https://www.microsoft.com/net/download/).

---

You will then need [Visual Studio Code](https://code.visualstudio.com) installed.

Next, click the Extensions icon and search for "Ionide":

The only plugin required for F# support in Visual Studio Code is [Ionide-fsharp](https://marketplace.visualstudio.com/items?itemName=Ionide.Ionide-fsharp). However, you can also install [Ionide-FAKE](https://marketplace.visualstudio.com/items?itemName=Ionide.Ionide-FAKE) to get [FAKE](https://fsharp.github.io/FAKE/) support and [Ionide-Paket](https://marketplace.visualstudio.com/items?itemName=Ionide.Ionide-Paket) to get [Paket](https://fsprojects.github.io/Paket/) support. FAKE and Paket are additional F# community tools for building projects and managing dependencies, respectively.
1 change: 1 addition & 0 deletions docs/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@

## [Tour of F#](fsharp/tour.md)
## [Get Started](fsharp/get-started/index.md)
### [Install F#](fsharp/get-started/install-fsharp.md)
### [Get Started with Visual Studio](fsharp/get-started/get-started-visual-studio.md)
### [Get Started with Visual Studio for Mac](fsharp/get-started/get-started-with-visual-studio-for-mac.md)
### [Get Started with Visual Studio Code and Ionide](fsharp/get-started/get-started-vscode.md)
Expand Down