How to properly remove PropertyChanged.Fody via NuGet
Asked Answered
D

4

6

I intended to use Fody.PropertyChanged in one of my projects, and it was properly added via NuGet:

Install-Package PropertyChanged.Fody

I realized, it was in the wrong project, so I used the uninstall command:

Uninstall-Package PropertyChanged.Fody

After that I added it to the proper project.

Now, when I try to build my solution, I get the following error in the initial project that shouldn't have Fody installed:

Fody: You don't seem to have configured any weavers. Try adding a Fody nuget package to your project. Have a look here http://nuget.org/packages?q=fody for the list of available packages.

There is no reference to Fody in the project, I deleted the Fody reference from the packages.config file and there is no XML file.

What else should I do?

Displeasure answered 24/2, 2015 at 10:42 Comment(0)
B
7

You need to also

Uninstall-Package Fody
Butch answered 28/2, 2015 at 9:41 Comment(0)
A
2

Remove The "FodyWeavers.xml" and Open the Project file with NotePad or notePad++ and remove the following lines

<Target Name="EnsureNuGetPackageBuildImports"  BeforeTargets="PrepareForBuild">
<Import Project="..\packages\Fody.1.29.2\build\portable-net+sl+win+wpa+wp\Fody.targets" Condition="Exists('..\packages\Fody.1.29.2\build\portable-net+sl+win+wpa+wp\Fody.targets')" />
Aspen answered 16/8, 2016 at 11:55 Comment(0)
T
1

I guess you've recently updated the Fody library? When it asked to replace the existing "FodyWeavers.xml" you might have permitted it to do so. If you have a backup of the project, get the "FodyWeavers.xml" from that and replace it with the new one. Clean and Rebuild the solution.

Tabber answered 24/2, 2015 at 17:15 Comment(3)
I did not update it. The Fody library should not be there at all. Seemingly it is not there but the project contains some hidden reference to it.Displeasure
Are you using the PropertyChanged.Fody library?Tabber
Read the initial post. In one of the projects I use, in the other I don't want to, yet it complains about it.Displeasure
S
0

This doesn't specifically address the project you don't want Fody in, but sometimes VS gives vague/odd errors.

I just went through a similar issue after installing PropertyChanged.Fody for the first time, and couldn't build as soon as I included and referenced it... I wonder if any of these details from my experience might help (making sure these points exist in the project you want the lib in).

  1. Make sure you have the following references in your packages.config from when you ran Install-Package PropertyChanged.Fody:
<package id="Fody" version="1.24.0" targetFramework="net45" developmentDependency="true" /> 
<package id="PropertyChanged.Fody" version="1.49.0" targetFramework="net45" developmentDependency="true" />
  1. Make sure there is FodyWeavers.xml in the top level of the project you want to use it in.

  2. FodyWeavers.xml should look like this (I had to add <PropertyChanged /> to mine)

<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
  <PropertyChanged />
</Weavers>
Seato answered 11/3, 2015 at 17:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.