【问题标题】:Cannot Uninstall MySql Connector .Net 6.9.3, failure at MySql.Web.v20.dll无法卸载 MySql Connector .Net 6.9.3,MySql.Web.v20.dll 失败
【发布时间】:2015-05-03 01:37:32
【问题描述】:

环境: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

我确实看到了使用包管理器的帖子,它可以将库安装到项目中。这是一种解决方法,但这并不能解决如何卸载 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”。 受影响的参数是: 登录控制台 = 真 日志文件 = 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 卸载 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

【问题讨论】:

    标签: mysql .net windows mysql-connector


    【解决方案1】:

    为了后代或任何可能有一天会遇到这个问题的人,这里是修复:

    问题在于两台本地计算机上的 machine.config 文件。该文件没有正确的条目或任何让安装程序感到困惑的东西。

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

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

    【讨论】:

    • 你说的这个 machine.config 文件在哪里?
    • 这个 StackOverflow 问题为 32 位和 64 位系统提供了答案。 stackoverflow.com/questions/2325473/where-is-machine-config.
    • 我有完全相同的问题。在 bugs.mysql 上关注了你与 Gabriela 的所有对话,但仍然存在问题。
    • @Amir978 如果我周一有时间,我会看看这个问题。我确实记得这个话题很痛苦。
    猜你喜欢
    • 2014-02-11
    • 1970-01-01
    • 1970-01-01
    • 2015-12-01
    • 2016-01-16
    • 2016-03-16
    • 1970-01-01
    • 2018-10-12
    • 2012-11-12
    相关资源
    最近更新 更多