无法卸载MySql连接器。净6.9.3,在MySql.Web.v20.dll失败

Env: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 \assembly\ GAC_MSIL \ MySql.Web \ v4.0_6.9.3.0__c5687fc88969c44d

这个文件夹包含这些文件:

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

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

关键是:

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

这会告诉我,安装程序试图find一些东西,但失败了。

对于所有好奇的人,使用“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的旧版本并希望得到重命名的原始版本的人,那么您可以在类似于registry的path中find:

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

我发现一些文章谈到解决scheme是从pipe理员启动一个命令提示符运行卸载。 没有骰子!

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

 "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连接器networking6.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连接器networking6.9.3 \ Assemblies \ v2.0 \ MySql.Web.v20.InstallLog程序集path= C:\ Program文件(x86)\ Development \ Database \ MySQL \ MySQL连接器networking6.9.3 \ Assemblies \ v2.0 \ MySql.Web.v20.dll在卸载MySql.Web.Security.CustomInstaller安装程序期间发生exception。 System.NullReferenceException:未将对象引用设置为对象的实例。 卸载时发生exception。 这个例外将被忽略,卸载将继续。 但是,卸载完成后,应用程序可能没有完全卸载。

 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的网站上发现了一篇文章,其中提到了一个到machine.config文件的链接,并提到了一些有趣的内容,请参阅此响应 。 这是一个复制和粘贴。

 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. 

很明显,这个问题可以追溯到几年,是间歇性的。 甲骨文/ MySQL团队没有采取任何措施来解决这个问题,我是可怜的灵魂,在两台机器上遇到了这个问题。

其他链接

在Oracle解决scheme上发布

在MSDN上不太有用的回应

为了后代或其他任何有可能遇到这个问题的人,下面是解决办法:

问题是两台本地机器上的machine.config文件。 该文件没有适当的条目或任何困扰安装程序。

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

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