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 does not work in the dotnet cli

See original GitHub issue

I added Fody to a project created with dotnet new and set up my own FodyWeavers.xml. However, dotnet build fails with

/Users/yavorgeorgiev/.nuget/packages/fody/2.0.7/build/netstandard1.4/Fody.targets(53,5): error MSB4062: The "Fody.WeavingTask" task could not be loaded from the assembly /Users/yavorgeorgiev/.nuget/packages/fody/2.0.7/build/netstandard1.4/../../Fody.dll. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. [/Users/yavorgeorgiev/Projects/foo/foo.csproj]
/Users/yavorgeorgiev/.nuget/packages/fody/2.0.7/build/netstandard1.4/Fody.targets(53,5): error MSB4062:  Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [/Users/yavorgeorgiev/Projects/foo/foo.csproj]
    0 Warning(s)
    1 Error(s)

According to https://github.com/dotnet/cli/issues/5457 it seems that a way to solve this would be to provide two sets of assemblies - one built with the regular .NET Framework and another built with .NET Core, and switch between the two based on the value of MSBuildRuntimeType.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:20 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
MihaMarkiccommented, Sep 25, 2017

OTOH one can use a combination of MSBuild and dotnet test --no-build. So, not really that important anymore to me since that’s a simple workaround.

3reactions
MihaMarkiccommented, Sep 19, 2017

I’d really like to see it working as well. While MSBuild can be used, there is another collateral: nunit tests won’t run because they run only using dotnet test which doesn’t work with fody due to this problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can Fody and its plugins be used with .NET Core (3.0)?
It should work. Fody is compatible with .NET Standard. Create a new WPF app using the WPF App (.NET Core) template in Visual...
Read more >
Fody, your opinion? : r/dotnet
Fody project (helpers based on Fody) looks very convenient. anyone using it? Any problem with debugging (not sure if it's a problem since...
Read more >
Troubleshooting - .NET SDK — Realm
First, check that the FodyWeavers.xml file contains an entry for Realm. · It is also possible that the installation of Fody has failed....
Read more >
Troubleshoot .NET tool usage issues
Discover the common issues when running .NET tools and possible solutions.
Read more >
.NET IL Weaving for those who know nothing about . ...
Since Fody uses MSBuild, it works on Visual Studio for both Windows and Mac. All you got to do is install the PropertyChanged.Fody...
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