惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
I
InfoQ
B
Blog RSS Feed
D
Docker
GbyAI
GbyAI
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
F
Fortinet All Blogs
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
人人都是产品经理
人人都是产品经理
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
M
MIT News - Artificial intelligence
C
Check Point Blog
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
博客园 - Franky
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
V2EX
Last Week in AI
Last Week in AI
L
LangChain Blog

博客园 - Nio

[转载] 常用第三方开源上传组件总结 Dev Express google doc 无法访问解决 NHibernate 查詢多表返回到IList<Model>中 用 HTML 格式导出 Excel 时,如何保留显示网格线 清除 SQL SERVER 2005 事务日志 [原]Excel与OWC做报表总结 owc控件不能在win server 2003 64位中使用 禁用浏览器后退按钮方案 asp.net连接数据库(SQL Server 2005 Express)详细说明 js 中replace的用法 - Nio - 博客园 当前标识没有对"Temporary ASP.NET Files"的写访问权限的解决办法 SqlServer 205 Express 常见问题 在模态窗口中提交后,如何关闭窗口再刷新父页面 Reporting Services 在程式中部署 .NET 事件模型教程(三)转载 .NET 事件模型教程(二)转载 .NET 事件模型教程(一)转载 .net Resource
Oracle Exception: Could not load file or assembly ‘Oracle...
Nio · 2011-02-26 · via 博客园 - Nio

9Apr/10

Oracle Exception: Could not load file or assembly ‘Oracle.DataAccess, Version=2.111.7.20…

Last week, I was having performance issues with my workstation. I was told to remove unused files and applications. I had previously installed ODAC 11g for the Oracle Data Providers. After realizing they were not backwards compatible with the Oracle10g providers we're using in production, I removed ODAC 11g using the Oracle Universal Installer. Apparently, that doesn't completely remove references to the 11g client or components.

After removing files and directories, I began receiving the following error when accessing an application locally:

1 Exception message: Could not load file or assembly 'Oracle.DataAccess, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

To see what Oracle libraries are installed in the GAC, I ran the following command from a Visual Studio command prompt:

1 gacutil /l | find /i "Oracle" > c:\Scripts\oracle.txt

This gave me the following list (note: Oracle 2.111.7.20 libraries are installed by ODAC 11g)

01 Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86
02   Oracle.Management.Omo, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86
03   Oracle.VsDevTools, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86
04   Oracle.Web, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86
05   Policy.2.102.Oracle.DataAccess, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86
06   System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86
07   Oracle.DataAccess, Version=1.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342
08   Oracle.DataAccess, Version=1.102.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342
09   Oracle.Management.Omo, Version=1.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342
10   Oracle.VsDevTools, Version=1.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342
11   Policy.1.102.Oracle.DataAccess, Version=1.102.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342
12   Policy.10.1.Oracle.DataAccess, Version=1.102.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342
13   Policy.10.2.Oracle.DataAccess, Version=1.102.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342
14   Policy.9.2.Oracle.DataAccess, Version=1.102.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342
15   System.Data.OracleClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

I have spent a week trying to figure out why these libraries wouldn't uninstall from the GAC and why I couldn't possibly remove them from the Oracle Universal Installer.

To manually uninstall these libraries, you'll have to run the following commands from a Visual Studio Command Prompt:

1 gacutil /u "Oracle.Management.Omo, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86"
2 gacutil /u "Oracle.VsDevTools, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86"
3 gacutil /u "Oracle.Web, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86"
4 gacutil /u "Policy.2.102.Oracle.DataAccess, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86"

Here's the part that got me: I installed ODT, not just ODAC. This comes with a number of add-ons for Visual Studio (including Health Monitoring and Profiling). So, you have to manually edit the machine.config to get everything completely removed.
So,
Edit C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config and remove all references from the above libraries.

After following these steps, I was finally able to load the application locally using the ODAC/ODP.NET libraries for Oracle 10g.