- ABP Framework version: v8.0
- UI Type: Angular / MVC / Blazor WASM / Blazor Server
- Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..) / MongoDB
- Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
- Exception message and full stack trace:
- Steps to reproduce the issue:
复现步骤 1、生成代码 ProjectTask,添加多对多的导航属性IdentityUser 2、运行系统,添加一行ProjectTask,添加两个IdentityUser,保存,正常 3、编辑ProjectTask,删除其中一个IdentityUser,保存,报内部服务器错误 4、编辑ProjectTask,删除其中一个IdentityUser,添加新的IdentityUser,保存,同样报错
20 Answer(s)
-
0
ABP CLI 和 SUITE的版本是? 错误日志是?
-
0
ABP CLI 和 SUITE的版本是? 错误日志是?
ABP CLI 是 最新的版本 abp suite update --p 没有看到错误日志,代码到这里就报错了(通用内部方法,调试不了) return await _projectTaskRepository.UpdateAsync(projectTask);
-
0
您直接生成代码试试就知道了,只要是导航的多对多关系,只要做了删除操作,保存时就一定会报错的。
-
0
你先分享一下内部服务器错误的日志.
-
0
你先分享一下内部服务器错误的日志.
去哪里查看错误日志
-
0
你先分享一下内部服务器错误的日志.
你用abp suite 可以复现的。没有改动任何代码。
-
0
App logs:
YourWebHostProject/Logs/logs.txt
Suite logs: C:\Users\usernmae.abp\suite\logs
-
0
App logs:
YourWebHostProject/Logs/logs.txt
Suite logs: C:\Users\usernmae.abp\suite\logs
查看了,操作后,发现日志没有记录任何报错信息
-
0
-
0
生成的代码,选择 ApplicationTemplate,MVC,MS SQL SERVER 数据库
-
0
好的
-
0
这是我的到的错误日志
[11:12:11 ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": {}, "validationErrors": null } [11:12:11 ERR] The property 'BookAuthor.BookId' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal. System.InvalidOperationException: The property 'BookAuthor.BookId' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal. at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.NavigationFixer.ConditionallyNullForeignKeyProperties(InternalEntityEntry dependentEntry, InternalEntityEntry principalEntry, IForeignKey foreignKey)
-
0
这是我的到的错误日志
[11:12:11 ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": {}, "validationErrors": null } [11:12:11 ERR] The property 'BookAuthor.BookId' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal. System.InvalidOperationException: The property 'BookAuthor.BookId' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal. at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.NavigationFixer.ConditionallyNullForeignKeyProperties(InternalEntityEntry dependentEntry, InternalEntityEntry principalEntry, IForeignKey foreignKey)
错误日志在哪里能看到,我从YourProjectWebHost目录的 logs文件夹打开的log文件,是没有这个信息的。另外,这个错误有什么处理建议吗
-
0
-
0
这是EF Core 8 的一个bug
请关注 https://github.com/dotnet/efcore/issues/32383
我会尝试找一个解决方案
-
0
这是EF Core 8 的一个bug
请关注 https://github.com/dotnet/efcore/issues/32383
我会尝试找一个解决方案
好的,感谢大神,期待早日解决。
-
0
-
0
-
0
这样也是可以的.
-
0
多谢,问题已解决。