I am trying to install MySql.Data and MySql.Data.Entity to my class lib.
Somehow there is no reference added to the project.
Things I've tried:
Update-Package -reinstall
(does not help)packages.config
contains the correct entries*.csproj
also has the correct entriesThis is the output:
Package 'MySql.Data.6.10.6' already exists in folder
'C:\Users\MYUSERNAME\Documents\Repositories\XXXXXXX\packages'
Added package 'MySql.Data.6.10.6' to 'packages.config'
Successfully installed 'MySql.Data 6.10.6' to XXXXXXXX.Persistence
Executing nuget actions took 1,6 sec
Strange thing is that NuGet
creates that \docs
in my project which is part of MySql
Nuget-package not adding package reference
I agree with Matt`s comment. You project targets framework should be .NET 4.5.1 or below. Because the package MySql.Data only contain assembly reference to .NET framework 4.5.2 for .NET framework:
However, this package also have the content files, which are compatible with .net framework. So when you add this package to the project(target framework 4.5.1 or below), nuget will install this nuget package without any error, just add the content file (\docs
) but not add any reference to the project.
To resolve this issue, you can change the target framework to 4.5.2 and above of this project or you should use the nuget package MySql.Data
with the version 6.9.11, which contain assembly reference to .NET framework 4.0 and 4.5:
Note: If you change the target framework to the .net framework 4.5.2 and above, you may get the error "The package 'MySql.Data' tried to add a framework reference to 'System.ComponentModel' which was not found in the GAC.
", please add a manually reference to missed library:
Package tried to add reference to System.Runtime which was not found in the GAC
Hope this helps.