GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Home
  • Learning center
  • Intro
  • Download and install
  • Create your app
  • Run your app
  • Edit your code
  • Next steps

This view

  • Original page
  • New address

GeezerVison is showing dotnet.microsoft.com — F# Tutorial - Hello World in 5 minutes | .NET

Skip to main content Microsoft .NET What is .NET? Why choose .NET? C# Web Cloud AI Data Game development Mobile & desktop App modernization Learn Download Docs Community Customer stories .NET Conf LIVE TV Microsoft Security Azure Dynamics 365 Microsoft 365 Microsoft Teams Windows 365 Microsoft AI Azure Space Mixed reality Microsoft HoloLens Microsoft Viva Quantum computing Sustainability Education Automotive Financial services Government Healthcare Manufacturing Retail Find a partner Become a partner Partner Network Microsoft Marketplace Software companies Blog Microsoft Advertising Developer Center Documentation Events Licensing Microsoft Learn Microsoft Research View Sitemap
.NET Conf 2026
The event is live! Tune in with the .NET community now to join the fun!
Watch now

F# Tutorial - Hello World in 5 minutes

Windows Linux macOS

Intro

Purpose

Install .NET and create your first application written in the F# programming language.

Prerequisites

None.

macOS 12.0 or later versions.

Time to Complete

5 minutes

Scenario

A simple application written in F# that prints Hello, World! to the console.

Download and install

To start building .NET apps, download and install the .NET SDK.

Download .NET 9 SDK (64-bit)
32-bit download | Arm64 download

Install .NET 9 SDK instructions

Download .NET 9 SDK x64 (Intel)
Download .NET 9 SDK Arm64 (Apple Silicon)

If you're on a Mac with an Apple M1 or M2 chip, you need to install the Arm64 version of the SDK.

Check everything installed correctly

Once you've installed, open a new command prompt and run the following command:

Once you've installed, open a new terminal and run the following command:

Command prompt
dotnet --version

If the installation succeeded, you should see version 9.0.100 or higher outputted:

Command prompt
9.0.100

If everything looks good, select the Continue button below to go to the next step.

Got an error?

If you receive a 'dotnet' is not recognized as an internal or external command error, make sure you opened a new command prompt. If quickly restarting your machine doesn't resolve the issue, use the I ran into an issue button to get help fixing the problem.

Create your app

In your command prompt, run the following command to create your app:

In your terminal, run the following command to create your app:

Command prompt
dotnet new console -lang F# -o MyFSharpApp

Note: some terminals may require you to add quotes around F# like this: "F#".

Then, navigate to the new directory created by the previous command:

Command prompt
cd MyFSharpApp

The dotnet command creates a new application of type console for you. The -lang parameter specifies the F# programming language and -o creates a directory named MyFSharpApp where your app is stored and populates it with the required files. The cd MyFSharpApp command puts you into the newly created app directory.

The main file in the MyFSharpApp folder is Program.fs. By default, it already contains the necessary code to write "Hello World from F#!" to the Console.

Program.fs
// For more information see https://aka.ms/fsharp-console-apps
printfn "Hello from F#"

Select the Continue button below to go to the next step.

Got an error?

If you receive a message similar to Template "Console Application" could not be created. Access to the path 'C:\Windows\System32\MyApp' is denied., change your current directory to one where you have permissions to create a new folder and try to run the command again.

If Windows can't find the SDK when you try to create the project and you are sure you have installed the SDK, your machine might have an issue with the PATH environment variable. See this Stack Overflow post for instructions on how to diagnose and fix this issue.

If you can't resolve the issue you're having, select the I ran into an issue button below to get help fixing the problem.

Run your app

In your command prompt, run the following command:

In your terminal, run the following command:

Command prompt
dotnet run

If your app ran successfully, you should see the following output:

Command prompt
Hello from F#

Congratulations, you've built and run your first F# app! Select the Continue button below to go to the next step.

Edit your code

Open Program.fs in any text editor and replace all of the code with the following. If you want to, you can replace the name Ana with your name.

Program.fs
// Define a new function to print a name.
let printGreeting name =
    printfn $"Hello {name} from F#!"

// Call your new function!
printGreeting "Ana"

Save the Program.fs file and run your code again.

Command prompt
dotnet run

If your app ran successfully, you should see an output similar to the following:

Command prompt
Hello Ana from F#!

Next steps

Now that you've got the basics, let's dig deeper into the language, with a self-guided learning of F#.

Microsoft Learn: Take your first steps with F#

F# for Beginners

Let Luis walk you through the basics of the F# language and learn how to code in F#:

You might also be interested in...

Learn F#

Free courses, tutorials, videos, and more about the programming language F#.

F# documentation

Browse F# documentation including language reference, language tour, and more.

Let's get started
Continue I ran into an issue
Continue I ran into an issue
Continue I ran into an issue
Continue I ran into an issue
Follow us
Your Privacy Choices
Consumer Health Privacy Powered by .NET 11.0.0 Contact Microsoft Support Privacy & Cookies Manage cookies Terms of Use Trademarks
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.