Search code examples
tfsfodyfody-propertychanged

TFS not weaving Fody assemblies


I am trying to use Fody.PropertyChanged on my project, so I have added [ImplementPropertyChanged] to my class.
It all works fine in local, on my dev machine.

However, when decompiling the TFS-generated binaries, I find that they are not weaved: they still have the Fody attributes.

The FodyWeavers.xml has the veaver:

<Weavers>
  <PropertyChanged />
</Weavers>

Where do I look, and what do I look at, to find out why my assemblies are not weaved?

Thanks!


Solution

  • I have managed to weave the assemblies this way :

    I have copied the contents of packages\Fody.xx\ into Assemblies\Fody\

    I then have modified the .csproj to point to the copied .targets file (towards the end of the .csproj) :

    <Import Project="$(SolutionDir)\Assemblies\Fody\build\dotnet\Fody.targets" Condition="Exists('$(SolutionDir)\Assemblies\Fody\build\dotnet\Fody.targets')" />
        <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
        <PropertyGroup>
            <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable 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('$(SolutionDir)\Assemblies\Fody\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\Assemblies\Fody\build\dotnet\Fody.targets'))" />
    </Target>
    

    I suspect that the TFS maintainers are downloading the Nuget packages in another folder (for instance to have only one copy of all the Nuget packages for all projects), which would mean that this kind of package cannot work the regular way.