Fody / Costura

Embed references as resources
MIT License
2.41k stars 275 forks source link

Configure Costura Fody for Release Only and Disable for Debug Builds #994

Closed avoitenko closed 1 month ago

avoitenko commented 1 month ago

I need to configure the Costura Fody weaver to be enabled only for Release builds and disabled for Debug builds in my C# project. Currently, Costura runs in all configurations, but I would like to restrict it to Release mode to improve build times and facilitate easier debugging. Please provide a solution or documentation on how to achieve this setup.

GeertvanHorrik commented 1 month ago

Please provide a solution or documentation on how to achieve this setup.

I expect this to take approx. 8 hours to implement. Are you or your company willing to financially support this feature?

avoitenko commented 1 month ago

I expect this to take approx. 8 hours to implement. Are you or your company willing to financially support this feature?

I represent an individual, not a company. I can donate an amount equal to 10 cups of coffee.

tom-englert commented 1 month ago

https://github.com/Fody/Home/blob/master/pages%2Fconfiguration.md

If you use Ms build property you should be able to configure this

Just make the package reference for costura or even fody conditional

avoitenko commented 1 month ago

@tom-englert Thanks for your advice. This configuration has been added to the project file:

<ItemGroup Condition="'$(Configuration)' == 'Release'">
    <PackageReference Include="Costura.Fody" Version="5.7.0" />
</ItemGroup>

It works for me.