nuget - Issues with MsBuild, SpecificVersion, and VSTS -


the scenario follows:

we have set of common .net libraries:

commonlib.main commonlib.specialized 

we have ci build builds both of these libraries, , places them our nuget repo. both available individual nuget packages - user may want load main, or can pull specialized package, include main.

specialized references main nuget package.

i'm making upgrades these packages.

first, upgraded main. updated version of main in assemblyinfo 1.1.0. 2.0.0.

msbuild include build number in "*" location.

the ci build ran, , version of main called "commonlib.main, version=2.0.0.345" published our nuget repo. on nuget repo, version listed "2.0.0", expect.

next, upgraded commonlib.specialized, , updated nuget reference commonlib.main, version=2.0.0.

i checked in these changes, , ci build ran again.

so now, ci build has create new version of main, version 2.0.0.346, , placed on nuget repo.

here's problem:

now, when run our ci build again, build of commonlib.specialized fails, because in .csproj, looks this:

<reference include="commonlib.main, version=2.0.0.345, culture=neutral, processorarchitecture=msil">       <hintpath>..\packages\commonliib.main-2.0.0\lib\net461\commonlib.main</hintpath>     </reference> 

but, in packages.config, has

<package id="commonlib.main" version="2.0.0" targetframework="net461" /> 

which pulls down commonlib.main, version=2.0.0.346.

our build fails here:

c:\program files (x86)\microsoft visual studio\2017\enterprise\msbuild\15.0\bin\amd64\microsoft.common.currentversion.targets(1964,5): warning msb3245: not resolve reference. not locate assembly "commonlib.main, version=2.0.0.345, culture=neutral, processorarchitecture=msil". check make sure assembly exists on disk. if reference required code, may compilation errors.  searchpath "{hintpathfromitem}". considered "..\packages\commonlib.main-2.0.0\lib\net461\commonlib.main.dll", name "commonlib.main, version=2.0.0.**346**, culture=neutral, publickeytoken=null" didn't match expected name "commonlib.main, version=2.0.0.**345**, culture=neutral, processorarchitecture=msil". 

i think fix setting specificversion false in project, seems rather crude. there better way resolve issue? feel shouldn't have refresh nuget references after every build.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -