Abp VNext +.Net 6.0 异常处理方法(随时更新)

1.An exception was thrown while activating

Swagger 调试接口错误解决方式:

1.EntityFrameworkCore 程序集下面的 xxxxDbContext.cs添加DBSET引用 public DbSet ProductAgency { get; set; }

2.判断是否少了一些引用文件。

3.Application程序集下的 类名跟 Application.Contract下面类名差异只能有一个 I 区别

例如

CodingAppService 实现的是 ICodingAppService

不能是 CodingAppService 实现 ICodingService

或者 CodingService 实现 ICodingAppService

2.An exception was thrown while activating abp vnextVolo.Abp.ObjectMapping.DefaultObjectMapper xxx

解决方式:

1.排除是否引用了其他项目 导致映射了其他项目的实体类

2.确认 对应程序集的Module是否 DependsOn 引用了其他项目的module 导致加载对应不上的实体映射

3.程序集中的引用包出现错误时

解决方法

1.找到程序集对应的 文件路径

2.地址栏 cmd

3.输入命令 dotnet restore 还原一下Nuget包

完成

4.An exception occurred in the database while saving changes for context type  

解决思路:

1.数据实体类 是否跟数据里字段一致 

2.数据实体类中的int  decimal等字段是否赋值正确

3.数据实体类中的字段长度是否正确

​​​​​​​4.数据实体类非空字段是否给了值

你可能感兴趣的:(AbpVNextCore,AbpVNextCore)