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

Access to the path 'FSharp.ProjectTemplate' is denied. #311

Closed yan0lovesha closed 6 years ago

yan0lovesha commented 6 years ago

Description

Got error when execute build.cmd on a new project.

Repro steps

Please provide the steps required to reproduce the problem

  1. Open Visual Studio Code.

  2. Open an empty folder.

  3. Press Ctrl + Shift + p. Input "F#: New Project(ProjectScaffold).

  4. Execute builld.cmd after Project created.

  5. In the cmd window. Input necessary information when the script asked.

Expected behavior

The build.cmd executed without errors.

Actual behavior

Errors: FsiEvaluationException:

Error: System.IO.IOException: Access to the path 'FSharp.ProjectTemplate' is denied. at System.IO.DirectoryInfo.MoveTo(String destDirName) at FSI_0005.Init.clo@167-5.Invoke(DirectoryInfo d) in D:\Repo\TMobileBill\init.fsx:line 167 at FSI_0005.Init.clo@158-2.Invoke(DirectoryInfo pd) in D:\Repo\TMobileBill\init.fsx:line 167 at Microsoft.FSharp.Primitives.Basics.List.iter[T](FSharpFunc2 f, FSharpList1 x) at Microsoft.FSharp.Collections.ListModule.Iterate[T](FSharpFunc2 action, FSharpList1 list) at <StartupCode$FSI_0005>.$FSI_0005_Init$fsx.main@() in D:\Repo\TMobileBill\init.fsx:line 158 Stopped due to error

Known workarounds

Please provide a description of any known workarounds.

Related information

EHotwagner commented 6 years ago

I experience the same problem.

DavidSSL commented 6 years ago

Ok I've been able to reproduce this problem and have also got a workaround.

Effectively, if you run this while the "project" is open in Visual Studio Code, the latter locks 'FSharp.ProjectTemplate', hence why you get the error.

The workaround is to close Visual Studio Code and then run "build.cmd"

jackfoxy commented 6 years ago

Closing. The path gets renamed during the init build.