Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Costura.Fody resources embedding in Debug mode?

I'm using Costura.Fody to embed all dlls into my application assembly.

Is there any way to disable Costura.Fody in Debug build mode? How to make Costura.Fody to work only in Release or custom build configuration?

like image 406
Hooch Avatar asked Feb 08 '16 09:02

Hooch


People also ask

What is costura?

<Costura UseRuntimeReferencePaths='true' />


2 Answers

According to Costura Github, a better possiblity is to open the .csproj and insert following line into the first <PropertyGroup>:

<DisableFody Condition="'$(Configuration)' == 'Debug'">true</DisableFody>

This way you don't have to modify the file again if there is a package update

like image 154
Apfelkuacha Avatar answered Oct 23 '22 05:10

Apfelkuacha


One solution might be to check your .csproj file and add a condition to the Fody-related lines. Something like this:

<Content Include="FodyWeavers.xml" Condition=" '$(Configuration)' == 'Release' " />

<Import Project="..\..\packages\Fody.1.29.4\build\dotnet\Fody.targets" Condition="Exists('..\..\packages\Fody.1.29.4\build\dotnet\Fody.targets') And '$(Configuration)' == 'Release' " />

Of course, this is mainly for simple use cases where you don't want any Fody extension to run in certain build environments.

like image 23
Kaj Nelissen Avatar answered Oct 23 '22 05:10

Kaj Nelissen