fsharp / fsharp/emacs-fsharp-mode
Fails loading project created with "dotnet new classlib -lang f#"
- Dominant language
- Emacs Lisp
- Stars
- 215
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Description
### Description
I cannot get fsharp-mode to load any project file: the simplest I've tried so far has been the one generated by `dotnet new classlib -lang f#` which also fails.
### Repro steps
(1) Create a directory with the following two files:
`Library.fs`:
```
namespace fsharp_mode_repro
module Say =
let hello name =
printfn "Hello %s" name
```
`fsharp_mode_repro.fsproj`:
```
netstandard2.0
fsharp_mode_repro
```
(2) Open `Library.fs` in Emacs.
(3) For good measure, press `C-c C-p` and navigate to the `fsharp_mode_repro.fsproj` file, and press `RET`.
### Expected behavior
I expect the project file to be loaded.
### Actual behavior
My message buffer gets a stack trace:
```
Unexpected internal error. Please report at https://github.com/fsharp/FsAutoComplete/issues, attaching the exception information:
System.InvalidOperationException: object_op ---> System.EntryPointNotFoundException: SystemNative_RealPath
at (wrapper managed-to-native) Interop+Sys.RealPath(string)
at System.IO.CoreFX.FileSystemWatcher+RunningInstance.Start () [0x00000] in :0
at System.IO.CoreFX.FileSystemWatcher.StartRaisingEvents () [0x00067] in :0
at System.IO.CoreFX.FileSystemWatcher.StartRaisingEventsIfNotDisposed () [0x00019] in :0
at System.IO.CoreFX.FileSystemWatcher.set_EnableRaisingEvents (System.Boolean value) [0x0001d] in :0
at (wrapper remoting-invoke-with-check) System.IO.CoreFX.FileSystemWatcher.set_EnableRaisingEvents(bool)
at System.IO.CoreFXFileSystemWatcherProxy+<>c.b__9_0 (System.IO.CoreFX.FileSystemWatcher internal_fsw, System.IO.FileSystemWatcher fsw) [0x00048] in :0
at System.IO.CoreFXFileSystemWatcherProxy.Operation (System.Action‘4[T1,T2,T3,T4] map_op, System.Action‘2[T1,T2] object_op, System.Object handle, System.Action‘2[T1,T2] cancel_op) [0x00184] in :0
--- End of inner exception stack trace ---
at System.IO.CoreFXFileSystemWatcherProxy.Operation (System.Action‘4[T1,T2,T3,T4] map_op, System.Action‘2[T1,T2] object_op, System.Object handle, System.Action‘2[T1,T2] cancel_op) [0x001a6] in :0
at System.IO.CoreFXFileSystemWatcherProxy.StartDispatching (System.Object handle) [0x00004] in :0
at System.IO.FileSystemWatcher.Start () [0x0001b] in :0
at System.IO.FileSystemWatcher.set_EnableRaisingEvents (System.Boolean value) [0x0003d] in :0
at (wrapper remoting-invoke-with-check) System.IO.FileSystemWatcher.set_EnableRaisingEvents(bool)
at FsAutoComplete.Project..ctor (System.String projectFile, Microsoft.FSharp.Core.FSharpFunc‘2[T,TResult] onChange) [0x000e2] in <59ba4889f78c97f6a74503838948ba59>:0
at .$Commands+project@106-1.Invoke (Microsoft.FSharp.Core.Unit _arg1) [0x00001] in <59ba4889f78c97f6a74503838948ba59>:0
at .$Commands+Project@103.Invoke (Microsoft.FSharp.Core.Unit unitVar) [0x00043] in <59ba4889f78c97f6a74503838948ba59>:0
at Microsoft.FSharp.Control.AsyncBuilderImpl+callA@851[b,a].Invoke (Microsoft.FSharp.Control.AsyncParams‘1[T] args) [0x00047] in <561d4e1d904cf4daa74503831d4e1d56>:0
```
### Known workarounds
I wish!
### Related information
* Operating system: **OS X 10.14.1**
* Branch: ...**elpa**?
* Emacs version: **GNU Emacs 26.1** (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511)) of 2018-05-31
* .NET Core SDK version: **2.2.103**, host version: **3.0.0-preview-27324-5** – but F# support given through Mono, version: Microsoft (R) F# Compiler version **10.2.3** for F# 4.5
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure by opening Library.fs and loading fsharp_mode_repro.fsproj with C-c C-p. Start from the FsAutoComplete.Project constructor and the FileSystemWatcher stack trace, then verify that the project loads without the reported SystemNative_RealPath exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- emacs-lisp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100