Problems with Fody/Costura
Asked Answered
M

3

7

To start with: I'm a complete beginner. I have two projects in one solution. One project is a console application, which is called from the windows form application. Now I want to add these to one executable. I was told that it was possible with Fody/Costura. I downloaded it and added the IncludeAssemblies code to the xml file. However, if i go to the debug folder, ther are still the two executables seperately (apart from some new generated files) Does the executable save in another place or did i do something wrong?

Millenarian answered 3/4, 2014 at 12:53 Comment(0)
I
9

As of version 1.5 Costura automatically cleans up the directory.

To disable this there is now a setting in the config. https://github.com/Fody/Costura#disablecleanup

Impassable answered 2/1, 2015 at 18:6 Comment(0)
P
5

It could be that Fody/Costura has already merged the separate DLL files (.NET assemblies) into the EXE. It doesn't take care of deleting those for you. You can easily check if this is the case by simply copying the executable out of the output directory along with any other dependencies besides the assemblies, and see if it runs.

Pacorro answered 15/5, 2014 at 7:36 Comment(1)
Also, of course, you can use an assembly inspector like Reflector to see in the Copy Local referenced assemblies have been embedded as resources into your final exe/dll.Bazooka
D
1
<Target 
    AfterTargets="AfterBuild;NonWinFodyTarget"
    Name="CleanReferenceCopyLocalPaths" >
     <Delete Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />
</Target>

in the project file also should work to clean up the duplicates

Dioptase answered 21/10, 2016 at 16:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.