3

I'm using Costura.Fody to embed referenced DLLs as resources in my EXE. It works fine except it's not embedding Interop.IWshRuntimeLibrary.dll.

How can I figure out why?

I'm using ILSpy to examine the EXE, which is how I know all of my references except IWshRuntimeLibrary are being embedded as resources. Plus the fact that users are getting exceptions about IWshRuntimeLibrary.

"Copy Local" is True for the reference to IWshRuntimeLibrary.

According to CorFlags, ILONLY = 1 for Interop.IWshRuntimeLibrary.dll, which I think means the DLL is pure managed code (not native or mixed mode).

I'm using Fody version 1.26.1 and Costura.Fody version 1.3.2.0 (the latest NuGet packages).

UPDATE

I tried using the IncludeAssemblies option to explicitly force Interop.IWshRuntimeLibrary to be embedded but it had no effect. I also tried specifying a bogus non-existent assembly and got no errors or mention of it in the build output.

markltx
  • 689
  • 8
  • 16
  • 1
    There's no need for Costura to embed interop libraries. Simply set the project property "Embed interop assemblies" to true. My guess: It may be that this property is set to true and therefor Costura does not include the actual interop assembly, because there are no types inside this assembly that are used by your application (because they are already embedded). However, that's just a guess... I am not familiar with Costura! – Carsten Nov 05 '14 at 16:50
  • @Aschratt actually there are cases where Visual Studio's "Embed interop assemblies" causes errors. see https://social.msdn.microsoft.com/Forums/vstudio/en-US/39edc2f3-781b-48c6-8e5f-f170ef00b10e/why-does-the-embed-interop-types-option-not-generate-the-appropriate-dispidattributes-in-some?forum=clr – dss539 Jan 20 '16 at 15:48
  • sometimes embed interop types = true causes issues. @Carsten visual studio does not do a good job of embedding the types definitions. I have seen this first hand with solidworks pias. – Amen Jlili Oct 01 '20 at 21:28

0 Answers0