Mysql: The located assembly's manifest definition does not match the assembly reference
2017-07-13 11:25
375 查看
将mysql.data.dll 从版本6.9.4.0换成6.5.4.0是遇到以下异常:
Could not load file or assembly 'MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
原因:
编译目录(debug或release)下的dll版本和.csproj中定义的版本不一致。
解决办法: 将debug或release下的dll版本换成与.csproj中定义的版本一致。
找到版本不一致的原因:比如多个.csproj引用了的相同的dll但是版本不一致。最后发现我有三个proj引用了MySql.Data但是版本不同,所以每次编译后就会有个csproj中的dll版本与实际copy的版本不一样。
更好的解决办法:
用GAC管理dll.
http://www.cnblogs.com/chenlulouis/archive/2010/06/30/1768176.html http://stackoverflow.com/questions/215026/the-located-assemblys-manifest-definition-does-not-match-the-assembly-reference https://msdn.microsoft.com/en-us/library/ex0ss12c%28VS.80%29.aspx (GAC命令的用法)
我的电脑在目录C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools 下可以找到GACUtil.exe
相关文章推荐
- The located assembly’s manifest definition does not match the assembly reference
- 安装.netFramework3.0Sp1之后报“the located assembly's manifest definition does not match the assembly refer”的解决
- Reference in the manifest does not match the identity of the downloaded assembly
- The reference in the deployment does not match the identity defined in the application manifest..
- Compiler Error Message: CS0234: The type or namespace name 'BorderDetails' does not exist in the class or namespace 'Infragistics.WebUI.Shared' (are you missing an assembly reference?)
- the project:mysql which is referenced by the classpath, does not exist
- UI' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference
- 解决连接MySQL时出现securityException异常,并且会有"That assembly does not allow partially trusted callers"的异常信息
- The declared package "com.hddaily.socketpool" does not match the expected
- Siebel Exception: The value entered in field Business Component of buscomp Repository WF Step does not match any value in the bo
- Siebel Exception: The value entered in field Business Component of buscomp Repository WF Step does not match any value in the bo
- Java compiler level does not match the version of the installed Java project fac
- Java compiler level does not match the version of the installed Java project facet
- Java compiler level does not match the version of the installed Java project facet
- Java compiler level does not match the version of the installed Java project fac
- Java compiler level does not match the version of the installed Java project facet
- Java compiler level does not match the version of the installed Java project
- 解决:The declared package..does not match the expected package..(转自百度空间)
- poi 3.2 SecurityException HPSFException signer information does not match signer information of other classes in the same package
- Eclipse Java compiler level does not match the version of the installed Java project facet.