Can't run NuGet package command in VS2015

I've done this many times with many projects on the same machine, but for some reason the following doesn't work for me:

  • Add your desired DLL (file server in this case) from NuGet Package Manager
  • Install Costura.Fody (by default it includes Fody 2.0.6, 2.0.7 available. I tried both versions which gave the same result)
  • Use the Package Manager Console to run the command Install-CleanReferencesTarget

    (copy / paste from https://github.com/Fody/Costura )

When I get to the third step (which has always worked so far), 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 tried to recreate the project, restart the computer, restart VS, start VS as admin, etc., but the same result. I also verified that the DLL in question (FileHelpers.dll) was copied locally.

I also looked at a file FodyWeavers.xml

in another project that included the same DLL and did not have this problem, and that it is identical to the one in this complex project:

<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
  <Costura/>
</Weavers>

      

Does anyone know why this is happening suddenly?

+3


source to share


3 answers


  • Open the NuGet Package Management Console (View-> Other Windows) and use the command line options, from here: Create and publish a package [^]
  • Compile this from source: NuGet Package Extension [^] (source is here: Home [^])


+1


source


According to the latest document , it looks like it has been removed in newer versions, which will automatically enable this feature. Cleaning can be disabled by modifying the Costura configuration file.

DisableCleanup

As part of Costura, inline assemblies are no longer included as part of an assembly. This cleaning can be disabled.

Default false

<Costura DisableCleanup='true' />

      



See also this post for more details on configuration options.

+1


source


Not an answer per se, but I had the same problem and managed to find a job.

Finally, instead of using a cmdlet, I added Target to my proj file at the bottom here . It seems to have worked.

0


source







All Articles