what's the logic behind what /Content updated when Updating package

Aug 22, 2011 at 11:35 PM

I have a web project package that consists of some assemblies + boilerplate sources [ App_Code, App_Start, root WebRole.cs, etc. ] + App_Start boiler plate sources + Web.config and Web.Debug/Release.config settings.

When NuGet package updates are processed what is the logic that is used to decide what /Content boilerplate sources and related files get updated and what ones are left as is, i.e. determined to have been modified by developer since the prior package version install put them in place?

Coordinator
Aug 22, 2011 at 11:37 PM

We look at the existing package (which is why we keep them around in the packages folder) and do a hash to see if any of the files installed by the package have been updated. We only update files that haven’t been updated.

Phil

From: robertob [email removed]
Sent: Monday, August 22, 2011 3:36 PM
To: Phil Haack
Subject: what's the logic behind what /Content updated when Updating package [nuget:270011]

From: robertob

I have a web project package that consists of some assemblies + boilerplate sources [ App_Code, App_Start, root WebRole.cs, etc. ] + App_Start boiler plate sources + Web.config and Web.Debug/Release.config settings.

When NuGet package updates are processed what is the logic that is used to decide what /Content boilerplate sources and related files get updated and what ones are left as is, i.e. determined to have been modified by developer since the prior package version install put them in place?

Aug 23, 2011 at 3:54 PM
Edited Aug 23, 2011 at 3:55 PM

thanks that helps.

With my source control managed projects using nuget packages i'm using the following pre-build event to ensure new enlistments, and tfs build machine processing, has an automated way for recreating the $(SolutionDir)packages content.  

Based on what you have outlined i'd have to ensure that was run prior to any package update process to ensure that the existing packages were in place.  

My related question would be what would this nuget $(SolutionDir)packages population process do in the case where my nuget private read-only feed, or nuget public read-write feed, has the only newer packages published and the older ones deleted.  Is this a scenario that suggests a reason for why you need to keep older packages published until such time as you can feel safe that everyone has updated to the current package version?

echo processing pre build events for sn=$(SolutionName) pn=$(ProjectName) cn=$(ConfigurationName) bt=$(BuildTarget)
echo relevant properties cn=$(computername) pa=$(processor_architecture) ibmb=$(IsBuildMachineBuild)
echo relevant directories sd=$(SolutionDir) pd=$(ProjectDir)
echo relevant directories td=$(TargetDir) od=$(OutDir)
echo relevant directories cd=%cd% msb=$(MSBuildBinPath) pf=%programfiles% wd=%windir%
for /d %%i in ( . ) do ( set TargetWoSpacesDir=%%~si\)
echo TargetWoSpacesDir=%TargetWoSpacesDir%
rem if /i "$(IsBuildMachineBuild)" == "true" (
  nuget install "$(ProjectDir)packages.config" -o "$(SolutionDir)packages" -s https://go.microsoft.com/fwlink/?LinkID=206669;http://mytfs10bm/nuget
  rem nuget install "$(ProjectDir)packages.config" -o "$(SolutionDir)packages" -s https://go.microsoft.com/fwlink/?LinkID=206669;http://mytfs10bm/nuget;\\mytfs10bm\NuGetPackages
rem )
rem note1 - this requires setting a < tfs project > | builds | < build definition > | process | advanced | msbuild arguments entry "/p:IsBuildMachineBuild=true"
rem note2 - change "$(IsBuildMachineBuild)" == "true" -> "" to debug this post build event processing using localhost ide build

Developer
Aug 23, 2011 at 4:27 PM
Edited Aug 23, 2011 at 4:28 PM

Looks like you want this (http://docs.nuget.org/docs/start-here/managing-nuget-packages-using-the-dialog). You can change the targets file to specify your source as well.

Aug 23, 2011 at 6:00 PM

Are you saying that if my vstudio | toosl | options | package manager [ or <solution/project> |  manage nuget packages | settings ]  | package sources view has my nuget read-only private feeds defined then when i run the "nuget install "$(ProjectDir)packages.config" -o "$(SolutionDir)packages" command it will honor those GUI configured package sources and so i don't need to specify them on the command line?

Are those GUI defined package sources settings global to the system or current user specific, i ask because on my tfs build machine when things build the process runs under the "Network Service" machine account.

 

Developer
Aug 23, 2011 at 6:30 PM

Yes and %appdata%\NuGet\NuGet.config