c# - Installing from Nuget adds reference to bin directory -
i'm installing avsan
(2.1.0) package using nuget package manager. expecting reference path to packages directory, like:
c:\app\packages\avsan.dll
but reference bin directory added:
c:\app\namespace\bin\avsan.dll
confusingly happening packages not others (i.e reference path packages folder, expected)
what i've tried
- uninstalling , reinstalling package
- googling similar (i've been unable find anything)
we found different projects within same solution using different versions 1 another. additionally, single project might have version listed in <reference>
element version listed in hintpath
.
we went through each .csproj file , manually edited them in sync.
- find line begins
<reference
includes information dll in question. - this line should indicate version. example:
<reference include="someassembly, version=4.0.54">
. there may additional text after suchculture
and/orpublickey
, etc. we're interested in version attribute. - make note of version.
- now check
<hintpath>
element within<reference
, contain path dll vs expect (where vs first). - this path contain version
..\packages\somepackage.4.0.56\lib\net45\someassembly.dll
(for example - in our case service stack packages). while isn't technically version (it's path file on system), typically correspond version of dll. - you need make sure these 2 things in sync - that path listed exists , leads expected dll.
in our case moving servicestack 4.0.54 4.0.56. of include
references 4.0.56 while path still pointed 4.0.54 version. because hint path did not point expected dll vs looked elsewhere , found believed acceptable match in project's \bin\debug
directory. not correct version.
it specific situation change , what.
this caused poor merges.
additionally cleared out \bin
, \packages
directories underneath project folder. reloaded solution , let nuget restore. clear things out nuget can pull down packages, , versions, needs. , prevents vs using wrong versions may located in project's \bin
directory. both safe delete. \packages
folder recreated , populated via nuget restor, , \bin
directory recreated , populated upon next build of solution.
Comments
Post a Comment