Answer the question
In order to leave comments, you need to log in
How to use MySQL .NET Connector in Powershell?
Good afternoon, I'm trying to use .Net Connector for MySQL ( https://dev.mysql.com/downloads/connector/net/)
in a powershell script
But when I try to use MySQL.Data.dll I get an
Add-Type -Path "C:\temp\MySQL.Data.dll"
error:
Add-Type : Невозможно загрузить файл или сборку "file:///C:\temp\MySql.Data.dll" или один из зависимых от них компонентов. Сборка создана в более поздней версии среды выполнения чем текущая, и не может быть загружена.
строка:1 знак:9
+ Add-Type <<<< -Path 'C:\temp\MySql.Data.dll'
+ CategoryInfo : NotSpecified: (:) [Add-Type], BadImageFormatException
+ FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.AddTypeCommand
Answer the question
In order to leave comments, you need to log in
I would start by upgrading to 5.1 or 7.0, but 7.0 is completely fresh and has its own nuances.
download windows management framework 5.1 and install. then try again.
ps and if the update does not help, then try loading the library like this:
[void][system.reflection.Assembly]::LoadFrom("C:\temp\MySQL.Data.dll")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question