Bug #109716 NuGet\Install-Package MySql.Data -Version 8.0.32 ERROR
Submitted: 20 Jan 2023 5:18 Modified: 20 Jan 2023 13:07
Reporter: lawrencwe ferguson Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:8.0.32 OS:Windows
Assigned to: CPU Architecture:Any

[20 Jan 2023 5:18] lawrencwe ferguson
Description:
Trying to install package NuGet\Install-Package MySql.Data -Version 8.0.32 gives error of Failed to add reference to 'comerr64'.

How to repeat:
using visual studio 2019 try installing nuget package MySql.Data -Version 8.0.32

Suggested fix:
?
[20 Jan 2023 5:19] lawrencwe ferguson
PM> NuGet\Install-Package MySql.Data -Version 8.0.32

Attempting to gather dependency information for package 'MySql.Data.8.0.32' with respect to project 'OEISQL', targeting '.NETFramework,Version=v4.5.2'
Gathering dependency information took 42 ms
Attempting to resolve dependencies for package 'MySql.Data.8.0.32' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'MySql.Data.8.0.32'
Resolved actions to install package 'MySql.Data.8.0.32'
Retrieving package 'Google.Protobuf 3.21.9' from 'nuget.org'.
Retrieving package 'MySql.Data 8.0.32' from 'nuget.org'.
Removed package 'Google.Protobuf.3.19.4' from 'packages.config'
Successfully uninstalled 'Google.Protobuf.3.19.4' from OEISQL
Removed package 'MySql.Data.8.0.31' from 'packages.config'
Successfully uninstalled 'MySql.Data.8.0.31' from OEISQL
Adding package 'Google.Protobuf.3.21.9' to folder 'C:\Users\Buddy\Documents\Visual Studio 2019\Projects\Current\OEI\packages'
Added package 'Google.Protobuf.3.21.9' to folder 'C:\Users\Buddy\Documents\Visual Studio 2019\Projects\Current\OEI\packages'
Added package 'Google.Protobuf.3.21.9' to 'packages.config'
Successfully installed 'Google.Protobuf 3.21.9' to OEISQL
Adding package 'MySql.Data.8.0.32' to folder 'C:\Users\Buddy\Documents\Visual Studio 2019\Projects\Current\OEI\packages'
Added package 'MySql.Data.8.0.32' to folder 'C:\Users\Buddy\Documents\Visual Studio 2019\Projects\Current\OEI\packages'
Install failed. Rolling back...
Package 'MySql.Data.8.0.32 : Google.Protobuf [3.21.9, ), K4os.Compression.LZ4.Streams [1.2.6, ), Portable.BouncyCastle [1.9.0, ), System.Buffers [4.5.1, ), System.Runtime.CompilerServices.Unsafe [5.0.0, )' does not exist in project 'OEISQL'
Removed package 'Google.Protobuf.3.21.9 : System.Memory [4.5.3, )' from 'packages.config'
Package 'MySql.Data.8.0.31' already exists in folder 'C:\Users\Buddy\Documents\Visual Studio 2019\Projects\Current\OEI\packages'
Added package 'MySql.Data.8.0.31' to 'packages.config'
Package 'Google.Protobuf.3.19.4' already exists in folder 'C:\Users\Buddy\Documents\Visual Studio 2019\Projects\Current\OEI\packages'
Added package 'Google.Protobuf.3.19.4' to 'packages.config'
Removing package 'MySql.Data.8.0.32 : Google.Protobuf [3.21.9, ), K4os.Compression.LZ4.Streams [1.2.6, ), Portable.BouncyCastle [1.9.0, ), System.Buffers [4.5.1, ), System.Runtime.CompilerServices.Unsafe [5.0.0, )' from folder 'C:\Users\Buddy\Documents\Visual Studio 2019\Projects\Current\OEI\packages'
Removed package 'MySql.Data.8.0.32 : Google.Protobuf [3.21.9, ), K4os.Compression.LZ4.Streams [1.2.6, ), Portable.BouncyCastle [1.9.0, ), System.Buffers [4.5.1, ), System.Runtime.CompilerServices.Unsafe [5.0.0, )' from folder 'C:\Users\Buddy\Documents\Visual Studio 2019\Projects\Current\OEI\packages'
Removing package 'Google.Protobuf.3.21.9 : System.Memory [4.5.3, )' from folder 'C:\Users\Buddy\Documents\Visual Studio 2019\Projects\Current\OEI\packages'
Removed package 'Google.Protobuf.3.21.9 : System.Memory [4.5.3, )' from folder 'C:\Users\Buddy\Documents\Visual Studio 2019\Projects\Current\OEI\packages'
Executing nuget actions took 5.15 sec
NuGet\Install-Package : Failed to add reference to 'comerr64'.
  Please make sure that the file is accessible, and that it is a valid assembly or COM component.
At line:1 char:1
+ NuGet\Install-Package MySql.Data -Version 8.0.32
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
[20 Jan 2023 13:07] MySQL Verification Team
Hello lawrencwe,

Thank you for the bug report.
I tried to reproduce your issue on windows 10 with Connector/NET 8.0.32 and tried to install MySql.Data but I am not seeing any issues at my end.

Regards,
Ashwini Patil
[24 Jan 2023 12:02] Kumar C
I get the same error 

NuGet\Install-Package : Failed to add reference to 'comerr64'.

I am using Visual Studio 2017.
[25 Jan 2023 13:57] Anonymous Guest
I get the same error on Win10 with VS 2022.

When you look into the Nuget Package and compare versions 8.0.31 and 8.0.32, then you can see that in 8.0.32 are some additional files (comerr64.dll, gssapi64.dll, k5sprt64.dll, krb5_64.dll, krbcc64.dll) which the package manager tries to install. But fails.

@MySQL Verification Team : In #109727 you tested it. Can you say what package management format you've used? "Packages.config" or "PackageReference"? Seems to be second one. Configurable in [Options --> NuGet Package Manager --> General --> PackageManagement
Because in my setup I use "packages.config" and it fails. Can you please check it again?
[28 Jan 2023 13:12] Mark Emeny
Also reproducible in Visual Studio 16.11.23

Executing nuget actions took 3.35 sec
Failed to add reference to 'comerr64'.
  Please make sure that the file is accessible, and that it is a valid assembly or COM component.
[30 Jan 2023 9:26] Rob Janssen
See https://bugs.mysql.com/bug.php?id=109670