EF6 连接Oracle 迁移数据错误解决方法

2022-11-13,,,,

环境:vs2015 + EF6 +ODP 数据库Oracle 11G

add-migratioin 正常,但在update-database 时报如下错误

System.Runtime.Serialization.SerializationException: Type is not resolved for member 'Oracle.ManagedDataAccess.Client.OracleException,Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342'

解决办法如下:

Installing Oracle.ManagedDataAccess.dll to GAC resolved my issue. If you installed Oracle Client or Oracle Database on your machine that might be the cause.

:\Windows\system32>cd E:\smn\packages\Oracle.ManagedDataAccess.\lib\net40

C:\Windows\system32>e:

E:\smn\packages\Oracle.ManagedDataAccess.\lib\net40>"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe" /i Oracle.ManagedDataAccess.dll
Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.

Assembly successfully added to the cache

注意:cmd要用管理员权限运行。

EF6 连接Oracle 迁移数据错误解决方法的相关教程结束。

《EF6 连接Oracle 迁移数据错误解决方法.doc》

下载本文的Word格式文档,以方便收藏与打印。