使用oracle数据库一个多月依赖这问题一直都得不到解决,最近任务不是很忙了,所以决定把这问题解决掉。写一篇文章做记录。

以上错误主要是net程序oracle数据库使用了Microsoft Enterprise Library 5.0

类库访问oracle数据库,其具有优秀的访问不通数据库的能力。使用方法不对也同样出现错误。解决办法是下载http://www.microsoft.com/en-us/download/confirmation.aspx?id=15104最新的类库并安装,安装后到安装目录获取需要的程序集到程序bin目录里面去(如果是类库的话也是放到类库bin目录去,生成解决方案后引用的dll自动会在web的bin目录去)如引用下面的

using Microsoft.Practices.EnterpriseLibrary.Data;

Microsoft.Practices.EnterpriseLibrary.Common;

Microsoft.Practices.EnterpriseLibrary.Logging;

...

引用类库后需要在配置文件配置,把下面的配置复制到配置文件上面去就ok了,注意的地方主要是程序集版本和数据库连接字符串,只要配置真确都没问题:

<configuration>

<configSections>

<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/>

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/>

<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/>

</configSections>

<dataConfiguration defaultDatabase="ccnf_ora"/>

<connectionStrings>

<add name="ccnf_ora" connectionString="Data Source=database;Password=dbpassword;User ID=username;max pool size=10000" providerName="System.Data.OracleClient"/>

</connectionStrings>

</configuration>

特别注意的是配置文件里面的Version=5.0.414.0,版本需要跟程序引用的版本一样,否则同样报以上的错误。

Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, ...的更多相关文章

  1. Could not load file or assembly 'Microsoft.Office.Interop.Word, Version=14.0

    参考地址一:点击这里 参考地址二:点击这里 解决方法: 使用office COM元件,电脑里必须要有相对应的版本,比如 Excel 14.0是对应Excel 2010 Excel 12.0是对应Exc ...

  2. Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its de

    页面加载时出现这个错误: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Cul ...

  3. Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0 系统找不到指定的文件。

    环境: web服务器: ip:192.168.1.32 ,安装有 Visual Studio Premium 2013 操作系统: Microsoft  Server 2008 r2+sp1 数据库服 ...

  4. Could not load file or assembly Microsoft.Web.Infrastructure

    Error info:Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=n ...

  5. Could not load file or assembly Microsoft.SqlServer.management.sdk.sfc version 11.0.0.0

    I have installed MS SQL Server 2012 R2 and when I try to update model from database under EDMX file ...

  6. 无法添加数据连接。Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0

    无法添加数据连接.Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0 V ...

  7. Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0 异常处理

    在本机开发asp.net .rdlc报表后,部署到本地没有问题. 当把网站发布后部署在IIS上,新电脑上(只安装了.net framwork4.5),提示如下错误: “Could not load f ...

  8. TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.Internal.IHttpResponseStreamWriterFactory' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=2.1.2.0 ...

    今天调试 asp.net core 2.0 项目时遇到了如下错误: TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.I ...

  9. 系统部署时的Could not load file or assembly 'Microsoft.VisualStudio.Enterprise.ASPNetHelper问题

    在web.config中,如下代码段 <compilation debug="true" targetFramework="4.0" assemblyPo ...

随机推荐

  1. findmaven的英文版本号上线了

    http://www.findmaven.net是一个查找Jar和查找Maven的Maven仓库搜索引擎.它能够依据Java开发人员提供的Class名或者Jar名找到包括它的Jar,同一时候提供Jar ...

  2. Linux中下载、解压、安装文件(转)

    原文地址:http://www.cnblogs.com/red-code/p/5539399.html 一.将解压包发送到linux服务器上: 1.在windos上下载好压缩包文件后,通过winscp ...

  3. PHP-006

    Q:应用程序执行时的路径 "D:\*******\protected\runtime" 是无效的. 请确定它是一个可被 Web server process 写入资料的目录. A: ...

  4. VR室内定位系统小结

    一.写在开始之前 不管是HTC 的Vive还是OC的CV1,都说明VR 定位设备和手柄都会成为未来VR的发展趋势. VR目前关键就是体验,全身心的投入,身临其境的感觉. 不能总玩着玩着,出戏了.这肯定 ...

  5. HTML基础做出属于自己的完美网页

    HTML HTML解释: HTML是英文Hyper Text Mark-up Language(超文本标记语言)的缩写,他是一种制作万维网页面标准语言(标记).相当于定义统一的规则(W3C),大家都来 ...

  6. poj_3261 后缀数组

    题目大意 给出一个数字串,找出其中至少重复K次的最长的子串长度. 题目分析 直接用后缀数组来求解,限制height[i]的长度来对排好序的后缀进行分组(这种方法经常在字符串问题中被使用).     先 ...

  7. c/c++左值和右值

    C/C++中的变量有左值和右值之分,他们的区别主要如下: (1)左值可以放在赋值号 = 的左右两边,右值只能放在赋值号 = 的右边 (2)在C语言中,有名字的变量即为左值:而函数的运行结果或表达式中间 ...

  8. MQTT的学习研究(二)moquette-mqtt 的使用之mqtt broker的启动

    在MQTT 官网 (http://mqtt.org/software)中有众多MQTT的实现方式.具体参看官网,Moquette是基于Apache Mina 的模型的一个Java MQTT broke ...

  9. Java虚拟机原理图解

    具体详情参考: http://blog.csdn.net/luanlouis/article/details/41046443 http://blog.csdn.net/luanlouis/artic ...

  10. eclipse/myeclipse 中的一些常用的快捷键

    一.eclipse 中的一些常用的快捷键 Eclipse的编辑功能非常强大,掌握了Eclipse快捷键功能,能够大大提高开发效率. Eclipse中有如下一些和编辑相关的快捷键. 1. [ALT+/] ...