Outlook Interop in .NET Core 3.0?

前端 未结 4 535
小鲜肉
小鲜肉 2021-01-04 11:05

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 compatib

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-04 11:41

    I had the same problem while migrating components with Office interop for Excel and Outlook to .NET Core 3.0. I found out that this is only a problem of the Nuget packages Microsoft.Office.Interop.Outlook and Microsoft.Office.Interop.Excel. The packages probably need an update to work with 3.0?

    If I make direct references to the Interop assemblies all is working well. Here is a link to an example for this.

    If you use Visual Studio, you need an additional workaround to achieve this. From the linked sample:

    Adding COM references to .NET Core projects from Visual Studio is not currently supported. The workaround is to create a .NET Framework project, add the COM references, and then copy the relevant COMReference elements in the project.

提交回复
热议问题