Reputation: 153
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.
Is there an alternative to this interop dll, or maybe a way to use .NET Framework for only this reference?
Upvotes: 14
Views: 8583
Reputation: 166
This worked for me:
Outlook automation is now working fine.
Upvotes: 15
Reputation: 12624
This is possible in a roundabout way. Here is how:
The nuget packages seem to be incompatible at the moment.
Reference: DotNet Samples
Upvotes: 0
Reputation: 5062
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.
Upvotes: 1
Reputation: 936
I am having the same issue when trying to use Microsoft.Office.Interop.Excel 15.0.4795.1000. It won't run when I target .net core 3.00 preview 7.
At this stage I do not think there is any other option than reverting back to .NEW Core 2.2.
Upvotes: 1