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

推荐订阅源

A
About on SuperTechFans
量子位
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 聂微东
V
Visual Studio Blog
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
V
V2EX
The GitHub Blog
The GitHub Blog
博客园_首页
月光博客
月光博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MyScale Blog
MyScale Blog
博客园 - 叶小钗
F
Fortinet All Blogs
T
Tailwind CSS Blog
GbyAI
GbyAI
酷 壳 – CoolShell
酷 壳 – CoolShell
IT之家
IT之家
WordPress大学
WordPress大学
B
Blog
H
Help Net Security

博客园 - 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();
    });
});