简体   繁体   English

Entity Framework Core 6 迁移包执行错误

[英]Entity Framework Core 6 Migration Bundle Execution Error

I am trying to use the new EF Core migration bundle to update my database schema.我正在尝试使用新的 EF Core 迁移包来更新我的数据库架构。

I have created the bundle using:我使用以下方法创建了捆绑包:

dotnet ef migrations bundle --self-contained --runtime linux-x64

But when I tried to update the database using:但是当我尝试使用以下方法更新数据库时:

./efbundle --connectionString ${MY_CONNETION_STRING}

Or even getting help by:甚至通过以下方式获得帮助:

./efbundle --help

I get the following error:我收到以下错误:

./efbundle: relocation error: ./efbundle: symbol nanosleep version GLIBC_2.2.5 not defined in file libpthread.so.0 with link time reference ./efbundle:重定位错误:./efbundle:符号 nanosleep 版本 GLIBC_2.2.5 未在带有链接时间参考的文件 libpthread.so.0 中定义

However, if I move the efbundle file to the publish directory, everything seems to work.但是,如果我将efbundle文件移动到publish目录,一切似乎都正常。

So my question is: Do I always have to put the efbundle file inside the publish folder?所以我的问题是:我是否总是必须将efbundle文件放在publish文件夹中? Or can I put it anywhere and apply the migrations to the database as it's a self-contained executable?或者我可以把它放在任何地方并将迁移应用到数据库,因为它是一个独立的可执行文件?

If not, what's the point of using the migrations bundle?如果不是,那么使用迁移捆绑包有什么意义?

Ok.好的。 I have installed the DotNet SDK on my Ubuntu machine with snap .我已经在我的 Ubuntu 机器上安装了DotNet SDK But after I reinstall it with apt it's now working from anywhere.但是在我用apt重新安装它之后,它现在可以在任何地方工作。 It seems that the problem is with the snap installation (I have also faced other EF issues before).似乎问题出在snap安装上(我之前也遇到过其他 EF 问题)。 But still I am not sure if it's possible/how to fix the issue for a snap installation.但我仍然不确定是否有可能/如何解决快速安装的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM