I have done this many times with many projects on the same machine, but for some reason the following is not working for me:
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?
NuGet Package ManagerSelect Project > Manage NuGet Packages. In the NuGet Package Manager page, choose nuget.org as the Package source. From the Browse tab, search for Newtonsoft.Json, select Newtonsoft.Json in the list, and then select Install. If you're prompted to verify the installation, select OK.
To use any command, open a command window or bash shell, then run nuget followed by the command and appropriate options, such as nuget help pack (to view help on the pack command). This documentation reflects the latest version of the NuGet CLI.
Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install . For a single package, delete the package folder and use nuget install <id> to reinstall the same one.
As per the latest doc, it seems to have been removed in newer versions, which will automatically enable the feature. Clean-up can be disabled by changing the Costura configuration file.
DisableCleanup
As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.
Defaults to
false
<Costura DisableCleanup='true' />
See also this post for more details on configuration options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With