Пытаясь заставить 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.
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"
- person Soldalma   schedule 08.05.2018