.NET Core3.1升级.NET5 oracle连接报错

 

如果报以下错误

 

 The type initializer for 'OracleInternal.ServiceObjects.OracleConnectionImpl' threw an exception.

 

解决方式是将.csproj文件中插入以下红色代码:

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DocumentationFile></DocumentationFile>
    <EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
  </PropertyGroup>

posted @ 2021-04-23 17:16  斌言  阅读(437)  评论(0编辑  收藏  举报