.NET Core 3.0 中的 Outlook 互操作? [英] Outlook Interop in .NET Core 3.0?
本文介绍了.NET Core 3.0 中的 Outlook 互操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将我们的项目从 .NET Framework 迁移到 .NET Core 3.0(C#、WPF),现在我不能再使用 Microsoft.Office.Interop.Outlook
,因为它不兼容 .NET 核心 3.0.我想要实现的是打开/发送预填充的 Outlook 电子邮件.
I migrated our project from .NET Framework to .NET Core 3.0 (C#, WPF) and now I can not use Microsoft.Office.Interop.Outlook
anymore, because it is not compatible with .NET Core 3.0. What I want to achieve is opening/sending prefilled Outlook Emails.
是否有替代此互操作 dll 的方法,或者是否可以仅将 .NET Framework 用于此引用?
Is there an alternative to this interop dll, or maybe a way to use .NET Framework for only this reference?
- Microsoft.Office.Interop.Outlook
- NetOffice.Outlook
推荐答案
这对我有用:
- 右键单击依赖项,然后单击添加引用"
- 在 COM 选项卡下选择 Microsoft Outlook 16.0 对象库.
- 在项目中的 Dependencies/COM 下,选择 Interop.Microsoft.Office.Interop.Outlook 引用,然后在属性"下将嵌入互操作类型"设置为是"
- 我还不得不卸载 Microsoft.Office.Interop.Outlook NuGet 包,因为它导致与 Dependencies/COM 中的引用发生冲突.
Outlook 自动化现在运行良好.
Outlook automation is now working fine.
这篇关于.NET Core 3.0 中的 Outlook 互操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文