Why does dotnet-fantomas need FSharp.Core, Version=4.4.1.0?

2

Trying to make dotnet-fantomas work, I installed both Fantomas and dotnet-fantomas from Nuget and added the lines

<ItemGroup>  
    <DotNetCliToolReference Include="dotnet-fantomas" Version="2.7.1" />
</ItemGroup>

to my .fsproj file. Then I added the folder where dotnet-fantomas.exe was installed to the Windows path.

Next I opened a command prompt in a folder with some .fs files and tried to run

dotnet-fantomas Asset.fs --force

I got the error message below. dotnet-fantomas is asking for FSharp.Core, Version=4.4.1.0 and I have FSharp.Core version 4.3.4. Browsing in the Nuget Package Manager that is the latest version available. My project has 4.4.3.0 as Target runtime and .NET Framework 4.6.1 as Target Framework.

What am I missing?

C:\Projects\bitbucket3\VSProjects\Fractal13\Fractal13>dotnet-fantomas Asset.fs --force
The following exception occurs while formatting stdin: System.IO.FileLoadException: Could not load file or assembly 'FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Fantomas.CodeFormatterImpl.createFormatContextNoChecker(String fileName, String source)
   at Fantomas.CodeFormatter.FormatDocument(String fileName, String source, FormatConfig config)
   at Fantomas.Cmd.Program.processSourceString(Boolean isFsiFile, String s, TextWriter tw, FormatConfig config)
   at Fantomas.Cmd.Program.stringToFile@185(FSharpRef`1 force, FSharpRef`1 profile, FSharpRef`1 fsi, String s, String outFile, FormatConfig config)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Force writing original contents to Asset.fs.
f#
nuget
lint
asked on Stack Overflow May 8, 2018 by Soldalma

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0