Gergely
Gergely

Reputation: 7487

How to handle an .fsproj file on the command line?

I would like to use exercism to solve F# exercises. I do this on Fedora.

Exercism downloads an .fsproj file. How can I handle it from the command line?

Is there something like the command make for a Makefile?

Upvotes: 1

Views: 264

Answers (1)

Devon Burriss
Devon Burriss

Reputation: 2532

If you have the dotnet SDK installed.

dotnet build X.fsproj should restore and build the project.
dotnet run X.fsproj will run it. You can also run it against a .sln file.
dotnet test X.fsproj will execute your unit tests. Note: Here it reported I only had 1 test file (wrong) but picked up all my tests.

To test if you have it installed and on your PATH, execute: dotnet --version. The current version is 3.1.
dotnet --help will show you all possible commands.

Of interest may be that F# Interactive is now baked into the SDK.
dotnet fsi to enter interactive environment.
#quit;; to exit interactive environment.
This allows you to play with F# right in the command line.

Upvotes: 4

Related Questions