question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fody not playing well with MSBuild when updating Fody-versions

See original GitHub issue

Attached is a solution with the new csproj format (this bug is also present with the old csproj format).

It’s a console application with Fody 3.0.0 and PropertyChanged.Fody 2.4.0, just to have an example. There is also a pretty minimal config.msbuild-file, a build.cmd to run msbuild.

Do not open it in Visual Studio (Visual Studio works fine, MSBuild does not). Before doing anything, clear the nuget caches (C:\Users\Username\.nuget\packages for me)

Open a CMD prompt and navigate to the dir, and run build.cmd. It will restore the Fody and PropertyChanged.Fody packages, and then under FodyTarget, note that it says Fody: Fody (version 3.0.0.0) Executing.

Then open FodyTestNewFormat.csproj in a text editor, and change the version of Fody to 3.1.4, and save. (As would happen if changing branch in git and the branches had different Fody-versions) Go back to the CMD prompt and run build.cmd again. It will restore Fody 3.1.4 correctly from NuGet, but under FodyTarget, it still says Fody: Fody (version 3.0.0.0) Executing.

If you run build.cmd again without altering anything, you might get it to use Fody 3.1.4

This bug also works with decrementing the version (and it then using the higher version). The versions selected here are randomly selected, and works with eachother, but if the versions are not compatible, then it will fail the build, even though the versions in the .csproj are compatible with eachother!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
0x53Acommented, Aug 17, 2018

This sounds like it is related to MsBuild Node Reuse - which is one of it’s worst features and has only caused pain for me so far.

You can disable it either through a command line argument, or globally through an environment variable.

I’d suggest the env var: MSBUILDDISABLENODEREUSE=1 https://blogs.msdn.microsoft.com/msbuild/2007/04/16/node-reuse-in-multiproc-msbuild/

0reactions
bendiknesbocommented, Sep 10, 2018

Thank you for that reproduction-zip, @tom-englert. You proved that it was not related to Fody, so we can close this issue. I have raised an issue with msbuild. Regarding your second point: I was able to reproduce it by msbuild generally, without using the config.msbuild

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fody is only supported on MSBuild 16 and above. Current ...
Now, my project/solution will no longer build. The error is: "Fody is only supported on MSBuild 16 and above. Current version: 15."
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found