【发布时间】:2017-04-22 03:43:15
【问题描述】:
我正在处理邮件服务,但我似乎无法引用 System.Net.Mail 或 MailKit。我在尝试为我的 PCL 项目参考下载 nuget 包时遇到此错误。解决此问题的替代方法似乎是什么?有人建议我使用Office365 Outlook 服务,但我不知道如何使用?
Could not install package 'Mail.dll 3.0.16292.1158'. You are trying to
install this package into a project that targets
'.NETPortable,Version=v4.5,Profile=Profile7', but the package does not
contain any assembly references or content files that are compatible with
that framework. For more information, contact the package author.
【问题讨论】:
-
Mail.dll 不是 MailKit 也不是 System.Net.Mail。也就是说,MailKit 不支持 Profile7(MimeKit 支持,但那是因为它不需要任何 Socket 支持)。 Profile7 不支持套接字,因此任何 SMTP、POP3 或 IMAP 库都不可能支持 Profile7。
-
您为什么要针对 PCL?您要支持哪些平台?您是否考虑过直接使用 .NET 4.5 或 .NET Core?您需要定位 >= .netstandard1.3 才能使用 MailKit,但这就是 PCL 的未来。
-
@jstedfast 你有点回答了我的不确定性。我们的目标是信息亭/桌面赢得 10 个应用程序。我不是设置项目目标的人,所以我不确定我们为什么要使用 Profile 7。我会尽快回复您。
标签: c# xamarin office365 system.net.mail mailkit