<commit_before>---
layout: article
title: "Creating an F# ASP .Net Core application"
modified: 2016-10-04 10:08:33 +0200
tags: [fsharp, code, learning, netcore]
image:
  feature:
  teaser:
  credit:
  creditlink:
comments: true
share:
categories: blog
---

You can start by executing

    dontnet new -l fs<commit_msg>Adds content of generated files<commit_after>---
layout: article
title: "Creating an F# ASP .Net Core application"
modified: 2016-10-04 10:08:33 +0200
tags: [fsharp, code, learning, netcore]
image:
  feature:
  teaser:
  credit:
  creditlink:
comments: true
share:
categories: blog
---

You can start by executing

    dotnet new -l fs

This will create two files:

* Program.fs

    open System

    [<EntryPoint>]
    let main argv = 
        printfn "Hello World!"
        0 // return an integer exit code


* project.json

    {
      "version": "1.0.0-*",
      "buildOptions": {
        "debugType": "portable",
        "emitEntryPoint": true,
        "compilerName": "fsc",
        "compile": {
          "includeFiles": [
            "Program.fs"
          ]
        }
      },
      "tools": {
        "dotnet-compile-fsc":"1.0.0-preview2-*"
      },
      "frameworks": {
        "netcoreapp1.0": {
          "dependencies": {
            "Microsoft.NETCore.App": {
              "type": "platform",
              "version": "1.0.1"
            },
            "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160629"
          }
        }
      }
    }


Executing

    dotnet build

will restore the packages and build successfully. But it is not a ASP .Net core project.

Executing

    dotnet run

will print to console

    Hello World
{'fraction_non_alphanumeric': 0.12259615384615384, 'fraction_numerical': 0.03485576923076923, 'mean_word_length': 2.0719557195571956, 'pattern_counts': {'":': 16, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7150086', 'n_tokens_mistral': 579, 'n_tokens_neox': 526, 'n_words': 155}