惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog
IT之家
IT之家
博客园 - 聂微东
The Cloudflare Blog
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
H
Help Net Security
博客园 - 叶小钗
V
V2EX
WordPress大学
WordPress大学
J
Java Code Geeks
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
C
Check Point Blog
B
Blog
D
DataBreaches.Net
美团技术团队
罗磊的独立博客

博客园 - HUGO.CM

安装OpenCode后,无法使用。解决方案 修改Abp中Auto API Controllers中 默认生成的 Put、Delete请求 vs2022 开发Python 中文报错:SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xc4 in position 0: invalid continuation byte 执行abp命令时,出现死循环解决方案 ABP与BootstrapBlazor 本地化相关处理 【机译】ABP Helper Methods Blazor文件上传异常:Did not receive any data in the allotted time Abp报错:AbpException: No theme registered! Use AbpThemingOptions to register themes. Abp分布式实体缓存 Abp vNext 在控制台输出SQL 【译】在 ABP 框架项目中配置多个数据库上下文 ABP浏览页面报错:Could not find the bundle file '/libs/abp/core/abp.css' for the bundle 'LeptonXLite.Global' 或 'Basic.Global' 运行abp install-libs再报错npm ERR! code E404 Abp配置文件设置IdentityServer客户端 精简版Abp开发教程 - 第三章: 创建应用程序 精简版Abp开发教程 - 第二章: 创建实体与数据库 精简版Abp开发教程 - 第一章: 创建解决方案 Abp vNext 使用Mysql数据库 Abp vNext 修改默认表前缀 Abp vNext 使用sql2005、sql2008等脚本报错解决
Abp9.0.4运行DbMigrator,报错“The LINQ expression '@__...
HUGO.CM · 2025-02-10 · via 博客园 - HUGO.CM

今天刚升级到最新版,然后创建个项目玩玩,在执行DbMigrator,进行数据库迁移时,报错:
System.InvalidOperationException:“The LINQ expression '@__organizationUnitIds_0' could not be translated. Additional information: Primitive collections support has not been enabled. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.”

原因

是Abp用到了Pomelo.EntityFrameworkCore.MySql 9.0.0-preview.2.efcore.9.0.0导致

解决方案

XXXEntityFrameworkCoreModule中加入代码即可:

Configure<AbpDbContextOptions>(options =>
{
    options.UseMySQL(builder =>
    {
        //加入代码
        builder.TranslateParameterizedCollectionsToConstants();
    });
});