PowerShell:在 MacOS 中加载 MySql.Data.dll - 无法加载文件或程序集
PowerShell: Loading MySql.Data.dll in MacOS - Could not load file or Assembly
我正在尝试在 MacOS 上加载 MySql.Data.dll
,但遇到以下错误:
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly '/[FILE_PATH]/MySql.Data.dll'. The system cannot find the file specified. "
测试。ps1:
[void][System.Reflection.Assembly]::LoadFrom("./MySql.Data.dll")
我从 https://dev.mysql.com/downloads/connector/net/ 下载了连接器并选择了 .NET & Mono 作为操作系统。
在 Windows 机器上,以下工作正常(安装了连接器)
[void][System.Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\MySQL\MySQL Connector Net 8.0.25\Assemblies\v4.5.2\MySql.Data.dll")
我很难找到很多关于此的文档,所以我不确定它是否支持 MacOS。
TIA
这似乎是我的解决方法:
Add-Type -Path "./MySql.Data.dll"
我正在尝试在 MacOS 上加载 MySql.Data.dll
,但遇到以下错误:
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly '/[FILE_PATH]/MySql.Data.dll'. The system cannot find the file specified. "
测试。ps1:
[void][System.Reflection.Assembly]::LoadFrom("./MySql.Data.dll")
我从 https://dev.mysql.com/downloads/connector/net/ 下载了连接器并选择了 .NET & Mono 作为操作系统。
在 Windows 机器上,以下工作正常(安装了连接器)
[void][System.Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\MySQL\MySQL Connector Net 8.0.25\Assemblies\v4.5.2\MySql.Data.dll")
我很难找到很多关于此的文档,所以我不确定它是否支持 MacOS。
TIA
这似乎是我的解决方法:
Add-Type -Path "./MySql.Data.dll"