【发布时间】:2023-03-04 04:04:01
【问题描述】:
我正在从与dotnet publish 打包的 Dotnet Core 2.0 WebApp 构建一个 docker 容器,但以这种方式发布不会复制Microsoft.EntityFrameworkCore.Tools.DotNet 中启用dotnet-ef 命令的扩展。
具体来说,我想在容器中运行dotnet ef 命令,但是我得到了这个错误:
No executable found matching command "dotnet-ef"
我的 .csproj 文件包含这个,所以 dotnet-ef 在主机上可以正常工作:
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
有没有办法从使用 dotnet publish 打包的 dotnet 应用程序运行迁移?
【问题讨论】:
-
参见 Ben Day 的 Deploy EF Core Migrations from a DLL。
标签: c# docker .net-core entity-framework-core