fsprojects / ProjectScaffold

A prototypical .NET solution (file system layout and tooling), recommended for F# projects
http://fsprojects.github.io/ProjectScaffold
The Unlicense
515 stars 154 forks source link

Running build.fsx in FSI, a workaround #353

Closed halcwb closed 4 years ago

halcwb commented 4 years ago

Description

I want to run some of the code in the build.fsx in the FSI. This is very handy to check the helper functions and figure out what they do.

Repro steps

NA

Expected behavior

NA

Actual behavior

NA

Known workarounds

I have modified the header of the build.fsx somewhat:

#if FAKE
#load ".fake/build.fsx/intellisense.fsx"
#endif

#if !FAKE
#load ".paket/load/netstandard2.1/Build/build.group.fsx"
#if !INTERACTIVE
#r "Facades/netstandard"
#endif
#r "netstandard"
#endif

#load "docsTool/CLI.fs"

This setup assumes that you run:

dotnet tool restore and dotnet paket generate-load-scripts

There are 2 caveats do:

  1. VS code crashes when changing the build.fsx this way
  2. It works wel in VS2019, however, the build.group.fsx references Mono.Posix.dll which cannot be found on a non mono windows machine. So I manually comment out that reference in the build.group.fsx.

But then it works quite well. I don't know whether there is a better way to achieve this?

Related information

halcwb commented 4 years ago

Sorry wrong repository