Getting "Could not load file or assembly 'FSharp.Core, Version=4.7.0.0" for pubished application

1

I created a F# console application with DB migrations. When I run the command:

dotnet fm migrate -c "Server=(localdb)\MsSQLLocalDB;Database=Foo;Trusted_Connection=True" -a .\DbMigrations.dll -p SqlServer 

I get the error:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'FSharp.Core, Version=4.7.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621) ---> System.IO.FileLoadException: Could not load file or assembly 'FSharp.Core, Version=4.7.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

The content of DbMigrations.proj is:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <OutputType>Exe</OutputType>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="202003221630_AddDayCloseTable.fs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="FluentMigrator" Version="3.2.1" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Update="FSharp.Core" Version="4.7.1" />
  </ItemGroup>
</Project>

And published folder contains FSharp.Core.dll. And .deps.json file fragment is:

"FSharp.Core/4.7.1": {
        "runtime": {
          "lib/netstandard2.0/FSharp.Core.dll": {
            "assemblyVersion": "4.7.0.0",
            "fileVersion": "4.700.20.10408"
          }
        },
        "resources": {
          "lib/netstandard2.0/cs/FSharp.Core.resources.dll": {
            "locale": "cs"
          },
          "lib/netstandard2.0/de/FSharp.Core.resources.dll": {
            "locale": "de"
          },
          "lib/netstandard2.0/es/FSharp.Core.resources.dll": {
            "locale": "es"
          },
          "lib/netstandard2.0/fr/FSharp.Core.resources.dll": {
            "locale": "fr"
          },
          "lib/netstandard2.0/it/FSharp.Core.resources.dll": {
            "locale": "it"
          },
          "lib/netstandard2.0/ja/FSharp.Core.resources.dll": {
            "locale": "ja"
          },
          "lib/netstandard2.0/ko/FSharp.Core.resources.dll": {
            "locale": "ko"
          },
          "lib/netstandard2.0/pl/FSharp.Core.resources.dll": {
            "locale": "pl"
          },
          "lib/netstandard2.0/pt-BR/FSharp.Core.resources.dll": {
            "locale": "pt-BR"
          },
          "lib/netstandard2.0/ru/FSharp.Core.resources.dll": {
            "locale": "ru"
          },
          "lib/netstandard2.0/tr/FSharp.Core.resources.dll": {
            "locale": "tr"
          },
          "lib/netstandard2.0/zh-Hans/FSharp.Core.resources.dll": {
            "locale": "zh-Hans"
          },
          "lib/netstandard2.0/zh-Hant/FSharp.Core.resources.dll": {
            "locale": "zh-Hant"
          }
        }
      }

What should I do to fix this?

f#
fluent-migrator
asked on Stack Overflow Mar 23, 2020 by Pavel Voronin

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0