安装了MySQL Connector/Net 5.20之后在VS2008中新建连接,居然直接报告错误
Package Load Failure
Package 'MySQL Connector Net 5.2.0' has failed to load properly ( GUID = {79A115C9-B133-4891-9E7B-242509DAD272} ). Please contact package vendor for assistance. Application restart is recommended, due to possible environment corruption. Would you like to disable loading this package in the future? You may use 'devenv /resetskippkgs' to re-enable package loading.
反复安装几次都无效,只好求助万能的google了,看来这个问题还是普遍存在的,总结一下解决方法:
首先执行一条命令:msiexec /a MySql.Data.msi /qb TARGETDIR="C:\MySQL_VS",将安装包解压到C:\MySQL_VS目录中,然后复制C:\MySQL_VS\Visual Studio Integration目录到C:\Program Files\MySQL\MySQL Connector Net 5.2.0目录
然后修改注册表中的:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Packages\{79A115C9-B133-4891-9E7B-242509DAD272}
它里面的CodeBase字段中多写了一个“\”符号,删除多余的“\”之后,重启VS2008就可以了。
成名已久MySQL居然犯下这样的低级错误,真不知道是因为不重视.net还是因为他们的测试不够。