I have done this many times with many projects on the same machine, but for some reason the following is not working for me:
- Add desired DLL (filehelpers in this case) from NuGet package manager
- Install Costura.Fody (by default it includes Fody 2.0.6; 2.0.7 is available I tried both versions which produced the same result)
- Use Package Manager Console to run command
Install-CleanReferencesTarget(copy/pasted from https://github.com/Fody/Costura)
When I get to step three (which has always worked up until now) I get the following error:
PM> Install-CleanReferencesTarget
Install-CleanReferencesTarget : The term 'Install-CleanReferencesTarget' is not recognized
as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Install-CleanReferencesTarget
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Install-CleanReferencesTarget:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I have tried recreating the project, restarting my PC, restarting VS, running VS as admin, etc but same result. I also verified the DLL in question (FileHelpers.dll) is set to copy local.
I also looked at the FodyWeavers.xml file in another project that included the same DLL and didn't have this issue, and that it is identical to the one in this troublesome project:
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
<Costura/>
</Weavers>
Does anyone know why this is happening all of a sudden?