I'm trying to use MailKit dll as assembly in Powershell but there is no way it works. I've tried with add-type and with [System.Reflection.Assembly] methods bwithout success. The link to mailkit library:
https://github.com/jstedfast/MailKit
With this method :
$path="$HOME\.nuget\packages\mailkit\1.16.1\lib\net451\MailKit.dll"
[System.Reflection.Assembly]::LoadFile($path)
ther isn't reference to the assembly in memory. With this method :
Add-Type -Path $path
this is the error:
- Add-Type -Path $path
- ~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
- FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeCommand
Thanks
Daniele