无法卸载MySql Connector .Net 6.9.3,MySql.Web.v20.dll失败

时间:2015-03-02 16:05:07

标签: mysql .net windows mysql-connector

环境:Windows 7和8.1,都是x64

我无法卸载MySql Connector.Net或安装更新。我查看了错误日志,并在此时发生了故障。

Uninstalling assembly 'C:\Program Files (x86)\Development\Database\MySQL\MySQL Connector Net 6.9.3\Assemblies\v2.0\MySql.Web.v20.dll'.
Affected parameters are:
   logtoconsole = 
   logfile = C:\Program Files (x86)\Development\Database\MySQL\MySQL Connector Net 6.9.3\Assemblies\v2.0\MySql.Web.v20.InstallLog
   assemblypath = C:\Program Files (x86)\Development\Database\MySQL\MySQL Connector Net 6.9.3\Assemblies\v2.0\MySql.Web.v20.dll
An exception occurred during the uninstallation of the MySql.Web.Security.CustomInstaller installer.
System.NullReferenceException: Object reference not set to an instance of an object.
An exception occurred while uninstalling. This exception will be ignored and the uninstall will continue. However, the application might not be fully uninstalled after the uninstall is complete.
Uninstalling assembly 'C:\Program Files (x86)\Development\Database\MySQL\MySQL Connector Net 6.9.3\Assemblies\v2.0\MySql.Web.v20.dll'.
Affected parameters are:
   logtoconsole = 
   logfile = C:\Program Files (x86)\Development\Database\MySQL\MySQL Connector Net 6.9.3\Assemblies\v2.0\MySql.Web.v20.InstallLog
   assemblypath = C:\Program Files (x86)\Development\Database\MySQL\MySQL Connector Net 6.9.3\Assemblies\v2.0\MySql.Web.v20.dll
An exception occurred during the uninstallation of the MySql.Web.Security.CustomInstaller installer.
System.NullReferenceException: Object reference not set to an instance of an object.
An exception occurred while uninstalling. This exception will be ignored and the uninstall will continue. However, the application might not be fully uninstalled after the uninstall is complete.

基本上,卸载MySql.Web.v20.dll失败。

Oracle将此文件放在:

C:\的Windows \ Microsoft.NET \组件\ GAC_MSIL \ MySql.Web \ v4.0_6.9.3.0__c5687fc88969c44d

此文件夹包含以下文件:

MySql.Web.dll
MySql.Web.dll.old
MySql.Web.v20.dll

我确实看到了一个使用包管理器的帖子,它可以将库安装到项目中。这是一种解决方法,但这并不能解决如何卸载Oracle的MySql连接器的问题.Net

关键是:

System.NullReferenceException: Object reference not set to an instance of an object.

那会告诉我安装程序试图找到但失败的东西。

对于所有好奇的人,使用“mysql-connector-net-6.9.3.msi”修复安装,成功完成,然后使用MSI删除安装失败并显示相同的错误消息。

注意: 可以使用以下行获取详细日志:

C:\> C:\Users\Me\Downloads\mysql-connector-net-6.9.3.msi /lvx* C:\Users\Me\Downloads\mysql-connector-net-6.9.3-uninstall.log

该文件发生故障:

MSI (s) (3C:AC) [15:24:20:167]: Executing op: CustomActionSchedule(Action=ManagedWebUnInstall,ActionType=3073,Source=BinaryData,Target=CAQuietExec,CustomActionData="C:\Windows\Microsoft.NET\Framework\v4.0.30319\installUtil.exe" /LogToConsole=false /LogFile= /u "C:\Program Files (x86)\Development\Database\MySQL\MySQL Connector Net 6.9.3\Assemblies\v2.0\MySql.Web.v20.dll")

对于那些没有MSI较旧副本且想要重命名原始副本的人,那么你可以在类似于注册表的路径中找到它:

Computer\HKLM\SOFTWARE\Microsoft\Windows\currentVersion\Installer\userData\S-1-5-18\Products\00B758472CF889E4383C13AC77DFAD59\InstallProperties

我发现一些文章谈到了从命令提示符的管理启动运行卸载的解决方案。没有骰子!

我做了,首先执行修复操作后执行特定的卸载命令(通过管理命令提示符)。

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\installUtil.exe" /LogToConsole=true /u "C:\Program Files (x86)\Development\Database\MySQL\MySQL Connector Net 6.9.3\Assemblies\v2.0\MySql.Web.v20.dll"

输出结果为:     卸载正在开始。     请参阅日志文件的内容以获取C:\ Program Files(x86)\ Development \ Database \ MySQL \ MySQL Connector Net 6.9.3 \ Assemblies \ v2.0 \ MySql.Web.v20.dll程序集的进度。     该文件位于C:\ Program Files(x86)\ Development \ Database \ MySQL \ MySQL Connector Net 6.9.3 \ Assemblies \ v2.0 \ MySql.Web.v20.InstallLog。     卸载程序集'C:\ Program Files(x86)\ Development \ Database \ MySQL \ MySQL Connector Net 6.9.3 \ Assemblies \ v2.0 \ MySql.Web.v20.dll'。     受影响的参数是:        logtoconsole = true        logfile = C:\ Program Files(x86)\ Development \ Database \ MySQL \ MySQL Connector Net 6.9.3 \ Assemblies \ v2.0 \ MySql.Web.v20.InstallLog        assemblypath = C:\ Program Files(x86)\ Development \ Database \ MySQL \ MySQL Connector Net 6.9.3 \ Assemblies \ v2.0 \ MySql.Web.v20.dll     卸载MySql.Web.Security.CustomInstaller安装程序时发生异常。     System.NullReferenceException:未将对象引用设置为对象的实例。     卸载时发生异常。此异常将被忽略,卸载将继续。但是,卸载完成后可能无法完全卸载应用程序。

The uninstall has completed.
An exception occurred while uninstalling. This exception will be ignored and the uninstall will continue. However, the application might not be fully uninstalled after the uninstall is complete.

基本上,问题在于卸载自定义安装程序。

我在Oracle's site上发现了一篇文章,其中提到了一个指向machine.config文件的链接,并提到了一些有趣的内容,请参阅this response。这是复制和粘贴。

I went deeper and analyzed MySql.Web.Security.CustomInstaller.RemoveProfileProvider from connector C# code. Following code is not properly checked: 

XmlNodeList nodes = doc.GetElementsByTagName ("profile"); 
XmlNode providersNode = nodes [0].FirstChild; 
foreach (XmlNode node in providersNode.ChildNodes) 
{ 
string name = node.Attributes ["name"].Value; 
if (name == "MySQLProfileProvider") 
{ 

This code expects every XML node below machine.config's <system.web\profile\providers> to have "name" attribute. Otherwise it crashes. It was happening to me, cause I had <clear /> node there (which doesn't make much sense in machine.config, but is valid). 

In general .NET Connector installer is very sensitive of machine.config files, which comes from MySql.Web.Security.CustomInstaller class.

显然,这个问题可以追溯到几年前并且是间歇性的。 Oracle / MySQL团队没有采取任何措施来解决这个问题,而我是一个可怜的灵魂,他在两台机器上遇到了这个问题。

其他链接

Posting on Oracle w/solution

Less useful response on MSDN

1 个答案:

答案 0 :(得分:0)

为了后人或其他可能有一天遇到此问题的人,这里有修复:

问题是本地计算机上的machine.config文件。该文件没有正确的条目或任何与安装程序混淆的内容。

我比较了机器上的machine.config文件,在那里我可以安装/卸载到失败的机器并设置与MySql不同的行,然后继续尝试卸载(或在W81上安装/卸载) )再次。成功了!

这个问题真的让我陷入了困境。安装程序不应该对该文件敏感。错误消息有点错误,因为失败不是DLL而是machine.config。