Skip to content

abhiranjankumar00/CoreFSharp-Tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started with .NET Core using F# & VsCode debuuger

Prerequisites

Build Steps

  • Restore packages - dotnet restore
  • Build project - dotnet build
  • Launch webserver - cd CoreFSharp.Web; dotnet run

Steps to create a project

  • Create the top level project directory. We will use CoreFSharp directory for it. It should be same as project name.
    • mkdir CoreFSharp
    • cd CoreFSharp
  • Create solution File: dotnet new sln
  • Create a mvc subproject:
    • Create the sub-directory first: mkdir CoreFSharp.Web; cd CoreFSharp.Web
    • Initialize sub-project: dotnet new mvc -lang f#
  • Reference subproject in solution file: dotnet sln add ./CoreFSharp.Web/CoreFSharp.Web.fsproj
    • Verify it by calling dotnet sln list
    • Rebuild project: dotnet restore; dotnet build
  • Create a library sub-project:
    • Create the sub-directory first: mkdir CoreFSharp.Library; cd CoreFSharp.Library
    • Initialize sub-project: dotnet new classlib -lang f#
  • Reference subproject in solution file: dotnet sln add ./CoreFSharp.Library/CoreFSharp.Library.fsproj
    • Verify it by calling dotnet sln list
    • Rebuild project: dotnet restore; dotnet build
  • Adding subproject dependancy: Add new ItemGroup in CoreFSharp/CoreFSharp.Web.fsproj.
    <ItemGroup>
      <ProjectReference Include="../CoreFSharp.Library/CoreFSharp.Library.fsproj" />
    </ItemGroup>
  • Restore, Rebuild: dotnet restore; dotnet build
  • Launch web server w/o Debugger: cd CoreFSharp.Web; dotnet run. Note You should launch it from the mvc sub-project.

Debug session

  • Launch web server /w Debugger: In VsCode, start debug session with .NET Core Launch (web) (or just press F5).
    • Note: Make sure to set current working directory (cwd in .vscode/launch.json to web sub-project

Extra info

  • To check .net core version: dotnet --version
  • List subprojects referenced in solution file (execute it from project root directory): dotnet sln list
  • Files to be considered in .gitignore: */bin, */obj, *.swp

About

Introduction on how to create F# core MVC app

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published