【原创】ASP.NET Core WebApi 6 + Oralce EF Core配置

29 篇文章 1 订阅
14 篇文章 0 订阅
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.12" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.12" />
    <PackageReference Include="Oracle.EntityFrameworkCore" Version="5.21.4" />
    <PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.4" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />

虽然用了.NET 6,但是这些包的版本,不可以追求最新,否则有很多莫名其妙的错误。到处查资料,结果无解。

比如:

System.TypeLoadException:“Method ‘GetServiceProviderHashCode’ in type ‘ExtensionInfo’ from assembly ‘Oracle.EntityFrameworkCore, Version=5.0.21.1, Culture=neutral, PublicKeyToken=89b483f429c47342’ does not have an implementation.”

比如

System.InvalidOperationException:“No database provider has been configured for this DbContext. A provider can be configured by overriding the ‘DbContext.OnConfiguring’ method or by using ‘AddDbContext’ on the application service provider. If ‘AddDbContext’ is used, then also ensure that your DbContext type accepts a DbContextOptions object in its constructor and passes it to the base constructor for DbContext.”

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

赵庆明老师

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值