Build Nightmares
7/10 - Newtonsoft.Json.dll 6.x is installed in the GAC by an application on the dev server
- MSBuild no longer copys Newtonsoft.Json.dll during build.
- Build does not fail because old copies are in output folders.
8/11 - Newtonsoft.Json.dll 7.x is added to ClientProject.Services
- Build does not fail because this is not yet deployed.
9/8 - ClientProject.Services is referenced by ClientProject.Endpoint
- Local builds do not fail because last copied Newtonsoft.Json.dll is still 6.x
- Dev build copies Newtonsoft.Json.dll 7.x because it is not in the GAC.
- Dev deploy does not fail because 6.x is in the GAC.
9/11 10:00pm - ClientProject.Endpoint is deployed to UAT
- Endpoint fails to start with AutofacDependencyResolutionException and does not display inner exception details; eventually get to underlying dll load exception.
9/11 11:40pm - All projects corrected to use same verison of 6.x
- Build still copies 7.x from dirty output folders.
9/11 11:55pm - Folders are cleaned and Build is run again
- No longer copies any Newtonsoft.Json.dll
- Finally piece together how events of 7/10 are tied to how MSBuild works and how the default
copy local=true means only if not GAC'd but copy local=true after being toggled off then on again puts
<Private>True</Private>
on the reference which really means always copy. No seriously, that's a thing.
9/11 1:00am - Fix reference in the ClientProject.Endpoint by toggling CopyLocal off and back on.
- Confirm correct deployment in UAT!
9/11 1:30am - Discover that a workaround/fix exists in a later Nuget.
- Discussion: https://nuget.codeplex.com/workitem/4344
- Fix: https://nuget.codeplex.com/SourceControl/changeset/0b1c96abc37a5b3d8b482c686741e7b20e545790, btw "Try jiggling it" - is a great description for that commit.
9/11 1:45a - Quit software development forever (or until morning whichever comes fist).
9/12 - UPDATE NUGET in Visual Studio