Home

Cannot use OneNote interop in v6 - missing COMImportAttribute

LINQPad 6 now has the ability to reference Office COM primary interop assemblies through, apparently, a specialized nuget. However, this does not include the OneNote PIA.

Add the OneNote PIA manually via C:\Program Files (x86)\Microsoft Visual Studio\Shared\Visual Studio Tools for Office\PIA\Office15\Microsoft.Office.Interop.OneNote.dll

Also add a reference to Office.dll

Then create an instance of Application with var onenote = new Application();

LINQPad complains with

CS1756 Interop type 'IApplication' cannot be embedded because it is missing the required 'System.Runtime.InteropServices.ComImportAttribute' attribute.

This worked in LINQPad 5 (probably because it was based on .NET Framework instead of .NET Core). Is there a way to reference this assembly in LINQPad 6?

Comments

Sign In or Register to comment.