An error occurred while connecting to MySQL & quot; failed to Load file or assembly "MySql. Data, Ve

Source: Internet
Author: User
When CodeSmith4.1.3 is connected to MySQL, the following error occurs: failed to load the file or assembly "MySql. Data, Version5.1.4.0, Cultureneutral, ......", or a dependent item. The Assembly list definition found does not match the Assembly reference. Solution: Download the MySQL. Data. dll (5.1.4) assembly at ftp.ntu.edu.tw.

CodeSmith4.1.3 failed to Load file or assembly "MySQL. data, Version = 5.1.4.0, Culture = neutral ,........ or one of its dependencies. The Assembly list definition found does not match the Assembly reference. Solution: Download the MySQL. Data. dll (5.1.4) assembly at ftp.ntu.edu.tw.

CodeSmith4.1.3 failed to Load file or assembly "MySQL. data, Version = 5.1.4.0, Culture = neutral ,........ or one of its dependencies. The Assembly list definition found does not match the Assembly reference. "

Solution:
Download the MySQL. Data. dll (5.1.4) assembly at ftp.ntu.edu.tw/pub/MySQL/Downloads/Connector-Net/mysql-connector-net-5.1.4-noinstall.zip.

Put MySQL. Data. dll in the Bin directory of the CodeSmith directory and run it again. The problem is solved!

Note: the download of MySQL. Data. dll must correspond to the version number in the connection error prompt. Change "5.1.4" to the required version number.

The message "failed to load the file or assembly" MySql. Data, Version = 5.0.7.0, Culture = neutral, PublicKeyToken = c5687fc88969c44d "or one of its dependencies. The Assembly list definition found does not match the Assembly reference. (Exception from HRESULT: 0x80131040 )"

Copy MySQL. Data. dll to the Bin directory under CodeSmith. The call is still incorrect,

Later, we can see that the MySQL. Data. dll file version is 5.2.1.0, which is larger than the error message. It seems that we need to try the next 5.0.7.0,

Is the http://ftp.ntu.edu.tw/pub/MySQL/Downloads/Connecto r-Net/mysql-connector-net-5.0.7-noinstall.zip,

Copy the MySQL. Data. Dll file to the Bin directory under CodeSmith again, and then configure the test. OK.

It seems that CodeSmith has killed the database program calling and should be set to a configuration file to allow users to define their own versions so that they can be more flexible.

Http://www.cnblogs.com/68681395/archive/2010/09/26/1835971.html

Failed to Load file or assembly "Oracle. DataAccess, Version = 2.111.7.0, Culture = neutral, PublicKeyToken = 89b483f429c47342" or one of its dependencies. Trying to load a program with an incorrect format


For 64-bit operating systems: advanced options for the application pool of Oracle. DataAccess. dll iis

Set this parameter to true. The above is a 32-bit database. This is the solution for the last error. However, when the database is 64-bit, replace Oracle. DataAccess. dll with the file of the current database, and set the location to false.



Recently, Oracle was used in ASP. Net development. The database provider ODP. NET provided by Oracle was used, and the Oracle. DataAccess. dll component was used. In practice, "failed to Load file or assembly" Oracle. DataAccess, Version = 2.112.1.0… "appears several times ..."", As shown in. Here, the problem and solution are summarized as follows:

1. Possible causes

(1) reference error: when the file cannot be loaded, the path referenced by Oracle. DataAccess. dll may be incorrect;

(2) version mismatch: The Oracle. DataAccess. dll referenced in development does not match the version in Oracle. The so-called version mismatch means that the version number does not match; on the other hand, the 64-bit and 32-bit do not match. When using a 64-bit Oracle, you must use the corresponding 64-bit Oracle. dataAccess. dll.

2. Solution

(1) It is easy to check whether the reference has an error. Check whether the file Oracle. DataAccess. dll exists in the reference path;

(2) Oracle. dataAccess. dll is generally located in the Oracle installation directory ".. /product/11.2.0/dbhome_1/ODP. NET/bin/2.x/ ", you can use the Dll corresponding to Oracle in the program during development.

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.