You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to make this so that it does not virtualize methods if your build is set to "Release", but make it work if the build is set to "Debug" or the like?
The text was updated successfully, but these errors were encountered:
I don't see a way my plugin could solve this by itself without implementing a hack.
AFAIK Fody doesn't support enabling of addins on a conditional basis. But I need to check with @SimonCropp.
Currently I can only propose to try a manual modification in your csproj file.
In this part
<Import Project="..\packages\Fody.1.29.4\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.1.29.4\build\dotnet\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.1.29.4\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.4\build\dotnet\Fody.targets'))" />
</Target>
surround the <Import> tag with a <ImportGroup /> adding the condition to enable it for debug builds only.
in the <Target> tag add the Condition attribute to also enable it for debug builds only.
So far for the technical part.
My more general question to you is: Why would you want to do this? I can imagine you run your tests against debug builds, but use Release builds for production. I prefer to always deploy exactly the same binaries to production as you test in your CI build, therefore I ALWAYS build everything in Release, except when working in VS.
Is it possible to make this so that it does not virtualize methods if your build is set to "Release", but make it work if the build is set to "Debug" or the like?
The text was updated successfully, but these errors were encountered: