Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Fody: No weavers found. Add the desired weavers via their nuget package

I have already installed Fody in my application several and several times but still this error appears below, could anyone tell me why it happens? I use the latest version of Visual Studio and latest version of Framework

enter image description here

like image 378
gbcga97 Avatar asked May 08 '19 20:05

gbcga97


3 Answers

Sometimes (for unknown reason) FodyWeavers.xml cannot be added automatically when the package is added. You'll need to add it to the root of the project manually:

<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
  <Costura />
</Weavers>

I'm using Fody 4.2.1 and Costura.Fody 3.3.3

I hope it helps 😊

like image 115
Pavel Kovalev Avatar answered Oct 11 '22 02:10

Pavel Kovalev


In my case, FodyWeavers.xml is already exists because the PropertyChanged.Fody library was installed. if this file exists, just add <Costura /> to it.

Before

<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
  <PropertyChanged />
</Weavers>

After

<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
  <PropertyChanged />
  <Costura />
</Weavers>
like image 36
EgoistDeveloper Avatar answered Oct 11 '22 03:10

EgoistDeveloper


I had same issue on my Cake script using MSBuild command and I solved that:

a) Applying EgoistDeveloper above tip
b) Cleaning ./bin and ./obj folder of all projects under my solution folder
c) Adding -t:Clean,Restore,... msbuild parameter command line

like image 27
MSOA Avatar answered Oct 11 '22 02:10

MSOA