尝试dotnet-fantomas
工作,我从Fantomas
安装了dotnet-fantomas
和Nuget
并添加了行
<ItemGroup>
<DotNetCliToolReference Include="dotnet-fantomas" Version="2.7.1" />
</ItemGroup>
到我的.fsproj
文件。然后我将安装了dotnet-fantomas.exe
的文件夹添加到Windows路径。
接下来,我在包含一些.fs
文件的文件夹中打开了一个命令提示符,并尝试运行
dotnet-fantomas Asset.fs --force
我收到了以下错误消息。 dotnet-fantomas
要求FSharp.Core, Version=4.4.1.0
,FSharp.Core
版本为4.3.4。浏览Nuget Package Manager
这是可用的最新版本。我的项目以4.4.3.0
为目标运行时,.NET Framework 4.6.1
为目标框架。
我错过了什么?
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.