Fody does not work in the dotnet cli
See original GitHub issueI 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:
- Created 6 years ago
- Reactions:5
- Comments:20 (11 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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.