{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/core-docs/pulls/comments/69251376","id":69251376,"diff_hunk":"@@ -0,0 +1,315 @@\n+---\n+title: Building simple Fsolutions with the .NET CLI\n+description: Building simple Fsolutions with the .NET CLI\n+keywords: .NET, .NET Core\n+author: cartermp\n+manager: wpickett\n+ms.date: 06/20/2016\n+ms.topic: article\n+ms.prod: .net-core\n+ms.technology: .net-core-technologies\n+ms.devlang: dotnet\n+ms.assetid: 615db1ec-6ef3-4de2-bae6-4586affa9771\n+---\n+\n+Getting started with F# on .NET Core\n+====================================\n+\n+This article covers how you can get started with using F# on .NET Core with the .NET Core Preview 2 SDK.  It will go through building a multi-project solution with a Class Library, Console App, and xUnit test project.\n+\n+Prerequisites\n+-------------\n+\n+To begin, you must install the [.NET Core Preview 2 SDK](https://www.microsoft.com/net/core).\n+\n+This article uses the Command Line and [Visual Studio Code](https://code.visualstudio.com) as the text editor.  You can use any editor you like.\n+\n+Building a Simple Multi-project Solution\n+----------------------------------------\n+\n+1. Open up a Command Line/Terminal.\n+2. Create a new directory named `FSNetCore`.  Open Visual Studio code or your preferred editor inside this directory.  If you haven't already, \n+3. Under `FSNetCore`, create `src` and `test` directories.\n+4. Under `FSNetCore`, create a new file called `global.json`.  It should have this as its contents:\n+\n+```json\n+{\n+    \"projects\":[ \"src\", \"test\" ]\n+}\n+```\n+\n+Your solutions structure should now look like this:\n+\n+```\n+FSNetCore/\n+|---src/\n+|---test/\n+|---global.json\n+```\n+\n+### Writing a Class library\n+\n+1. Create a `Library` folder under `FSNetCore/src`.\n+2. From `FSNetCore/src/Library`, `dotnet new -l F#`.\n+3. Remove the `NuGet.Config` file.\n+4. Rename `Program.fs` to `Lib.fs`.\n+5. Open the `project.json` file and remove the `emitEntryPoint` entry from `buildOptions`.\n+6. Under `buildOptions/compile/includeFiles`, replace `Program.fs` with `Lib.fs`.\n+7. Remove the global `dependencies` section.\n+8. Under `frameworks`, change `netcoreapp1.0` to `netstandard1.6`.\n+9. Under `frameworks/netstandard1.6`, remove the `imports` section.\n+10. Under `frameworks/netstandard1.6/dependencies`, replace the `Microsoft.NETCore.App` package with `\"NETStandard.Library\":\"1.6.0\"`.  Add `\"Microsoft.FSharp.Core.netcore\": \"1.0.0-alpha-160629\"` and `\"Newtonsoft.Json\": \"9.0.1-beta1\"`.\n+11. Open `Lib.fs` and change the contents to the following code::\n+    ```fsharp\n+    module Library\n+\n+    open Newtonsoft.Json\n+\n+    let getJsonNetJson value = \n+        sprintf \"I used to be %s but now I'm %A!\" <|| (value,  JsonConvert.SerializeObject(value))\n+    ```\n+12. Run `dotnet restore` and `dotnet build`.  These should succeed.\n+\n+Your `project.json` file should look like this:\n+\n+```json\n+{\n+  \"version\": \"1.0.0-*\",\n+  \"buildOptions\": {\n+    \"compilerName\": \"fsc\",\n+    \"compile\": {\n+      \"includeFiles\": [\n+        \"Lib.fs\"\n+      ]\n+    }\n+  },\n+  \"tools\": {\n+    \"dotnet-compile-fsc\": {\n+      \"version\": \"1.0.0-preview2-*\",\n+      \"imports\": [\n+        \"dnxcore50\",\n+        \"portable-net45+win81\",\n+        \"netstandard1.3\"\n+      ]\n+    }\n+  },\n+  \"frameworks\": {\n+    \"netstandard1.6\": {\n+      \"dependencies\": {\n+        \"NETStandard.Library\":\"1.6.0\",\n+        \"Microsoft.FSharp.Core.netcore\": \"1.0.0-alpha-160629\",\n+        \"Newtonsoft.Json\": \"9.0.1-beta1\"    \n+      }\n+    }\n+  }\n+}\n+```\n+\n+And your `Lib.fs` file should look like this:\n+\n+```fsharp\n+module Library\n+\n+open Newtonsoft.Json\n+\n+let getJsonNetJson value = \n+    sprintf \"I used to be %s but now I'm %A!\" <|| (value,  JsonConvert.SerializeObject(value))\n+```\n+\n+### Writing a Console Application which Consumes the Class Library\n+\n+1. Create an `App` folder under `FSNetCore/src`.\n+2. From `FSNetCore/src/App`, `dotnet new -l F#`\n+3. Remove the `NuGet.Config` file.\n+4. Open the `project.json` file.\n+5. Remove the global `dependencies` section.\n+6. Under `frameworks/netcoreapp1.0/`, remove the `imports` section.\n+7. Under `frameworks/netcoreapp1.0/dependencies`, add the following after `Microsoft.NETCore.App`:\n+    ```json\n+    \"Microsoft.FSharp.Core.netcore\": \"1.0.0-alpha-160629\",\n+    \"Library\":{\n+      \"version\":\"1.0.0\",\n+      \"target\": \"project\"\n+    }\n+    ```\n+6. Change `Program.fs` to:\n+    ```fs\n+    open System\n+    open Library\n+\n+    [<EntryPoint>]\n+    let main argv = \n+        printfn \"Nice command line arguments!  Here's what JSON.NET has to say about them:\\n\"\n+\n+        for arg in argv do\n+            printfn \"%s\" <| getJsonNetJson arg\n+\n+        0 // return an integer exit code\n+    ```\n+7. Enter `dotnet restore` and `dotnet build` into the command line.  These should succeed.\n+8. Enter `dotnet run Hey Jude` into the command line.  You should see results like this:\n+\n+```\n+Nice command line arguments!  Here's what JSON.NET has to say about them:\n+\n+I used to be hey but now I'm \"\"hey\"\"!\n+I used to be jude but now I'm \"\"jude\"\"!\n+```\n+\n+Your `project.json` file should look like this:\n+\n+```json\n+{\n+  \"version\": \"1.0.0-*\",\n+  \"buildOptions\": {\n+    \"emitEntryPoint\": true,\n+    \"compilerName\": \"fsc\",\n+    \"compile\": {\n+      \"includeFiles\": [\n+        \"Program.fs\"\n+      ]\n+    }\n+  },\n+  \"tools\": {\n+    \"dotnet-compile-fsc\": {\n+      \"version\": \"1.0.0-preview2-*\",\n+      \"imports\": [\n+        \"dnxcore50\",\n+        \"portable-net45+win81\",\n+        \"netstandard1.3\"\n+      ]\n+    }\n+  },\n+  \"frameworks\": {\n+    \"netcoreapp1.0\": {\n+      \"dependencies\": {\n+        \"Microsoft.NETCore.App\": {\n+          \"type\": \"platform\",\n+          \"version\": \"1.0.0\"\n+        },\n+        \"Microsoft.FSharp.Core.netcore\": \"1.0.0-alpha-160629\",\n+        \"Library\":{\n+          \"version\":\"1.0.0\",\n+          \"target\": \"project\"\n+        }\n+      }\n+    }\n+  }\n+}\n+```\n+\n+And your `Program.fs` file should look like this:\n+\n+```fsharp\n+open System\n+open Library\n+\n+[<EntryPoint>]\n+let main argv = \n+    printfn \"Nice command line arguments!.  Here's what JSON.NET has to say about them:\"\n+\n+    for arg in argv do\n+        printfn \"%s\" <| getJsonNetJson arg\n+\n+    0 // return an integer exit code\n+```\n+\n+### Testing the Class Library with xUnit","path":"docs/fsharp/getting-started-netcore.md","position":217,"original_position":217,"commit_id":"360906d65c5381e10c33f2e40448649d69245fe9","original_commit_id":"360906d65c5381e10c33f2e40448649d69245fe9","user":{"login":"mairaw","id":12971179,"avatar_url":"https://avatars.githubusercontent.com/u/12971179?v=3","gravatar_id":"","url":"https://api.github.com/users/mairaw","html_url":"https://github.com/mairaw","followers_url":"https://api.github.com/users/mairaw/followers","following_url":"https://api.github.com/users/mairaw/following{/other_user}","gists_url":"https://api.github.com/users/mairaw/gists{/gist_id}","starred_url":"https://api.github.com/users/mairaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mairaw/subscriptions","organizations_url":"https://api.github.com/users/mairaw/orgs","repos_url":"https://api.github.com/users/mairaw/repos","events_url":"https://api.github.com/users/mairaw/events{/privacy}","received_events_url":"https://api.github.com/users/mairaw/received_events","type":"User","site_admin":false},"body":"It seems the name of the product is xUnit.net: https://xunit.github.io/","created_at":"2016-07-01T05:52:08Z","updated_at":"2016-07-01T05:52:08Z","html_url":"https://github.com/dotnet/core-docs/pull/728#discussion_r69251376","pull_request_url":"https://api.github.com/repos/dotnet/core-docs/pulls/728","_links":{"self":{"href":"https://api.github.com/repos/dotnet/core-docs/pulls/comments/69251376"},"html":{"href":"https://github.com/dotnet/core-docs/pull/728#discussion_r69251376"},"pull_request":{"href":"https://api.github.com/repos/dotnet/core-docs/pulls/728"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/core-docs/pulls/728","id":75918712,"html_url":"https://github.com/dotnet/core-docs/pull/728","diff_url":"https://github.com/dotnet/core-docs/pull/728.diff","patch_url":"https://github.com/dotnet/core-docs/pull/728.patch","issue_url":"https://api.github.com/repos/dotnet/core-docs/issues/728","number":728,"state":"open","locked":false,"title":"Add Getting Started with F# on .NET Core","user":{"login":"cartermp","id":6309070,"avatar_url":"https://avatars.githubusercontent.com/u/6309070?v=3","gravatar_id":"","url":"https://api.github.com/users/cartermp","html_url":"https://github.com/cartermp","followers_url":"https://api.github.com/users/cartermp/followers","following_url":"https://api.github.com/users/cartermp/following{/other_user}","gists_url":"https://api.github.com/users/cartermp/gists{/gist_id}","starred_url":"https://api.github.com/users/cartermp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cartermp/subscriptions","organizations_url":"https://api.github.com/users/cartermp/orgs","repos_url":"https://api.github.com/users/cartermp/repos","events_url":"https://api.github.com/users/cartermp/events{/privacy}","received_events_url":"https://api.github.com/users/cartermp/received_events","type":"User","site_admin":false},"body":"This updates the RC2 golden path scripts for F# to be compatible F# on .NET Core SDK Preview 2.","created_at":"2016-07-01T02:20:37Z","updated_at":"2016-07-01T05:52:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1dd250d258c6edc704a05325e8a5155dfab5dfc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/core-docs/pulls/728/commits","review_comments_url":"https://api.github.com/repos/dotnet/core-docs/pulls/728/comments","review_comment_url":"https://api.github.com/repos/dotnet/core-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/core-docs/issues/728/comments","statuses_url":"https://api.github.com/repos/dotnet/core-docs/statuses/360906d65c5381e10c33f2e40448649d69245fe9","head":{"label":"cartermp:update-fs-golden","ref":"update-fs-golden","sha":"360906d65c5381e10c33f2e40448649d69245fe9","user":{"login":"cartermp","id":6309070,"avatar_url":"https://avatars.githubusercontent.com/u/6309070?v=3","gravatar_id":"","url":"https://api.github.com/users/cartermp","html_url":"https://github.com/cartermp","followers_url":"https://api.github.com/users/cartermp/followers","following_url":"https://api.github.com/users/cartermp/following{/other_user}","gists_url":"https://api.github.com/users/cartermp/gists{/gist_id}","starred_url":"https://api.github.com/users/cartermp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cartermp/subscriptions","organizations_url":"https://api.github.com/users/cartermp/orgs","repos_url":"https://api.github.com/users/cartermp/repos","events_url":"https://api.github.com/users/cartermp/events{/privacy}","received_events_url":"https://api.github.com/users/cartermp/received_events","type":"User","site_admin":false},"repo":{"id":44759105,"name":"core-docs","full_name":"cartermp/core-docs","owner":{"login":"cartermp","id":6309070,"avatar_url":"https://avatars.githubusercontent.com/u/6309070?v=3","gravatar_id":"","url":"https://api.github.com/users/cartermp","html_url":"https://github.com/cartermp","followers_url":"https://api.github.com/users/cartermp/followers","following_url":"https://api.github.com/users/cartermp/following{/other_user}","gists_url":"https://api.github.com/users/cartermp/gists{/gist_id}","starred_url":"https://api.github.com/users/cartermp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cartermp/subscriptions","organizations_url":"https://api.github.com/users/cartermp/orgs","repos_url":"https://api.github.com/users/cartermp/repos","events_url":"https://api.github.com/users/cartermp/events{/privacy}","received_events_url":"https://api.github.com/users/cartermp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cartermp/core-docs","description":".NET Core documentation (work in progress).","fork":true,"url":"https://api.github.com/repos/cartermp/core-docs","forks_url":"https://api.github.com/repos/cartermp/core-docs/forks","keys_url":"https://api.github.com/repos/cartermp/core-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cartermp/core-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cartermp/core-docs/teams","hooks_url":"https://api.github.com/repos/cartermp/core-docs/hooks","issue_events_url":"https://api.github.com/repos/cartermp/core-docs/issues/events{/number}","events_url":"https://api.github.com/repos/cartermp/core-docs/events","assignees_url":"https://api.github.com/repos/cartermp/core-docs/assignees{/user}","branches_url":"https://api.github.com/repos/cartermp/core-docs/branches{/branch}","tags_url":"https://api.github.com/repos/cartermp/core-docs/tags","blobs_url":"https://api.github.com/repos/cartermp/core-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cartermp/core-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cartermp/core-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/cartermp/core-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cartermp/core-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/cartermp/core-docs/languages","stargazers_url":"https://api.github.com/repos/cartermp/core-docs/stargazers","contributors_url":"https://api.github.com/repos/cartermp/core-docs/contributors","subscribers_url":"https://api.github.com/repos/cartermp/core-docs/subscribers","subscription_url":"https://api.github.com/repos/cartermp/core-docs/subscription","commits_url":"https://api.github.com/repos/cartermp/core-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/cartermp/core-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/cartermp/core-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/cartermp/core-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/cartermp/core-docs/contents/{+path}","compare_url":"https://api.github.com/repos/cartermp/core-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cartermp/core-docs/merges","archive_url":"https://api.github.com/repos/cartermp/core-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cartermp/core-docs/downloads","issues_url":"https://api.github.com/repos/cartermp/core-docs/issues{/number}","pulls_url":"https://api.github.com/repos/cartermp/core-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/cartermp/core-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/cartermp/core-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cartermp/core-docs/labels{/name}","releases_url":"https://api.github.com/repos/cartermp/core-docs/releases{/id}","deployments_url":"https://api.github.com/repos/cartermp/core-docs/deployments","created_at":"2015-10-22T16:41:05Z","updated_at":"2016-06-24T17:41:37Z","pushed_at":"2016-07-01T02:19:34Z","git_url":"git://github.com/cartermp/core-docs.git","ssh_url":"git@github.com:cartermp/core-docs.git","clone_url":"https://github.com/cartermp/core-docs.git","svn_url":"https://github.com/cartermp/core-docs","homepage":"http://dotnet.readthedocs.org","size":15512,"stargazers_count":0,"watchers_count":0,"language":"PowerShell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"149086110d7470d97e1ab3e5969269626290b523","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":35890081,"name":"core-docs","full_name":"dotnet/core-docs","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/core-docs","description":"This repository contains .NET Documentation.","fork":false,"url":"https://api.github.com/repos/dotnet/core-docs","forks_url":"https://api.github.com/repos/dotnet/core-docs/forks","keys_url":"https://api.github.com/repos/dotnet/core-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/core-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/core-docs/teams","hooks_url":"https://api.github.com/repos/dotnet/core-docs/hooks","issue_events_url":"https://api.github.com/repos/dotnet/core-docs/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/core-docs/events","assignees_url":"https://api.github.com/repos/dotnet/core-docs/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/core-docs/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/core-docs/tags","blobs_url":"https://api.github.com/repos/dotnet/core-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/core-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/core-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/core-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/core-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/core-docs/languages","stargazers_url":"https://api.github.com/repos/dotnet/core-docs/stargazers","contributors_url":"https://api.github.com/repos/dotnet/core-docs/contributors","subscribers_url":"https://api.github.com/repos/dotnet/core-docs/subscribers","subscription_url":"https://api.github.com/repos/dotnet/core-docs/subscription","commits_url":"https://api.github.com/repos/dotnet/core-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/core-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/core-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/core-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/core-docs/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/core-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/core-docs/merges","archive_url":"https://api.github.com/repos/dotnet/core-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/core-docs/downloads","issues_url":"https://api.github.com/repos/dotnet/core-docs/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/core-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/core-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/core-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/core-docs/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/core-docs/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/core-docs/deployments","created_at":"2015-05-19T15:13:32Z","updated_at":"2016-07-01T02:40:47Z","pushed_at":"2016-07-01T03:21:38Z","git_url":"git://github.com/dotnet/core-docs.git","ssh_url":"git@github.com:dotnet/core-docs.git","clone_url":"https://github.com/dotnet/core-docs.git","svn_url":"https://github.com/dotnet/core-docs","homepage":"https://docs.microsoft.com/dotnet","size":17102,"stargazers_count":167,"watchers_count":167,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":173,"mirror_url":null,"open_issues_count":151,"forks":173,"open_issues":151,"watchers":167,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/core-docs/pulls/728"},"html":{"href":"https://github.com/dotnet/core-docs/pull/728"},"issue":{"href":"https://api.github.com/repos/dotnet/core-docs/issues/728"},"comments":{"href":"https://api.github.com/repos/dotnet/core-docs/issues/728/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/core-docs/pulls/728/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/core-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/core-docs/pulls/728/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/core-docs/statuses/360906d65c5381e10c33f2e40448649d69245fe9"}}}}
{"actor":{"display_login":"mairaw"}}