【发布时间】:2017-11-19 02:30:13
【问题描述】:
我正在尝试在 Powershell 中使用 MailKit dll 作为程序集,但它无法正常工作。 我尝试过使用 add-type 和 [System.Reflection.Assembly] 方法但没有成功。 mailkit库的链接:
https://github.com/jstedfast/MailKit
用这个方法:
$path="$HOME\.nuget\packages\mailkit\1.16.1\lib\net451\MailKit.dll"
[System.Reflection.Assembly]::LoadFile($path)
ther 不是对内存中的程序集的引用。 用这个方法:
Add-Type -Path $path
这是错误:
- 添加类型-路径 $path
- ~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
- FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeCommand
谢谢
丹尼尔
【问题讨论】:
-
发布您正在使用的实际代码、错误消息以及您如何安装 DLL。这里的人无法猜测你做了什么/正在做什么。
标签: powershell .net-assembly mailkit