NetOfficeFw / NetOffice

🌌 Create add-ins and automation code for Microsoft Office applications.
MIT License
697 stars 143 forks source link

stdole.dll in build folder #316

Closed TymurGubayev closed 2 years ago

TymurGubayev commented 3 years ago

The deployment table for Excel in documentation lists 4 dlls: ExcelApi.dll, OfficeApi.dll, VBIDEApi.dll and NetOffice.dll. But compiling a project referencing NetOfficeFw.Excel v1.8.1 NuGet additionally puts the stdole.dll in build folder. I'm pretty sure it is coming from GAC on my machine. Do I need to ship this dll with my app too?

jozefizso commented 3 years ago

Hi, stdole.dll should not be distributed with your app.

Our packages you configure your project to not embed interop types into the assembly so I'm not sure where the stdole.dll comes from.

TymurGubayev commented 3 years ago

Well, if I do embed interop types, the dll with those types is NOT copied; if I do NOT embed then I can set Copy Local to True and it IS copied.

I'm pretty sure what happens is VS sees a dll with CopyLocal = True and copies it and all its dependencies into the output folder.

jozefizso commented 3 years ago

You should have Copy Local = True and Embed Interop Types = False on NetOffice libraries.

The OfficeApi does reference stdole but it does not have to redistributed as the library is available on each release of Windows.

TymurGubayev commented 3 years ago

Ok, thanks. I guess I'll use a post-build action to always delete it.