.netcore 3.1 升级 .net5 :The type initializer for 'OracleInternal.ServiceObjects.OracleConnectionImpl' threw an exception.

1、将.csproj文件

<TargetFramework>net5.0</TargetFramework>

2、连接oracle,open时报错:The type initializer for 'OracleInternal.ServiceObjects.OracleConnectionImpl' threw an exception.

需要在.csproj文件添加:<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>

posted @ 2021-01-20 14:10  Cody&  阅读(397)  评论(0编辑  收藏  举报