Search code examples
.net-coreconsole-applicationfody-costura

Fody Costura not compiling into an exe


I have a .Net Core Console Application with a number of dependencies. My idea was to use a .Net weaver (Costura) to embed all the dependencies into the executable. However, what seems to be happening is that it's creating a dll, and embedding all the resources into that, and then having the executable with a single dependency of the dll. The FodyWeavers.xml looks like this:

<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
  <Costura />
</Weavers>

Is there a way to make Costura weave all the dependencies into the exe?


Solution

  • by default a Net Core Console Application does not produce an exe. have a look at this thread https://github.com/dotnet/cli/issues/6237#event-1901524875

    So i suspect costura is working by design, your project is building a dll and costura would be bundling references in to that dll.