Cocould not load file or assembly 'Microsoft. Practices. enterpriselibrary. Common, version = 5.0.414.0 ,...

Source: Internet
Author: User
Tags connectionstrings

The problem of dependency on Oracle databases for more than a month has not been solved. Recently, the task was not busy, so I decided to solve the problem. Write an article for record.

The above error mainly occurs when the net program Oracle database uses Microsoft Enterprise Library 5.0

The class library can access the Oracle database, which is capable of excellent access to the database. The same error occurs if the method is incorrect. The solution is to download the http://www.microsoft.com/en-us/download/confirmation.aspx? Id = 15104 latest class library and install it. After installation, go to the installation directory to obtain the required assembly and go to the bin directory of the program. (If the class library is used, go to the bin directory of the class library, after a solution is generated, the referenced DLL is automatically stored in the bin directory of the web.

Using Microsoft. Practices. enterpriselibrary. Data;

Microsoft. Practices. enterpriselibrary. Common;

Microsoft. Practices. enterpriselibrary. logging;

...

After the class library is referenced, You need to configure it in the configuration file. Copy the following configuration to the configuration file. Note that the Assembly version and database connection string are the main ones. If the configuration is correct, it is okay:

<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>

Note that the version in the configuration file is 5.0.414.0. The version must be the same as the version referenced by the program. Otherwise, the above error is also reported.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.