Naked Objects is now using NuGet in a reasonably sophisticated way. (See
http://nakedobjects.codeplex.com ) We’ve encountered a lot of pain points, and have managed to find workarounds in most cases, but we’re stuck on this one…
When we upgrade the NakedObjects.Mvc package (which you install from scratch into an Empty Mvc project) we are potentially upgrading not only the referenced assemblies, but any of the following types of files that were installed the first time:
Views, Controllers, Scripts, Config, and Code (such as the asax.cs, or the RunWeb class in App_Start)
Of these, NuGet only really seems to support updating the Config (allowing replacements for sections within config). In all other cases, if NuGet finds such a file already there it just skips over it. We therefore have to resort to PowerShell, which
is ugly enough in its own right, but made far worse by the fact that NuGet currently only allows us to run PowerShell after the rest of the install has completed.
One solution might be to version all our file names, so that new versions are automatically installed alongside the old - as JQuery does. But then you still need to make changes to other files that reference them so you're back to the same
problem. And it won’t work for code files such as controllers.
N.B. We note that Microsoft is not yet using NuGet to install MVC 3, even though the latter is open source. If it were, they'd be hitting exactly equivalent issues, as Naked Objects MVC is just a slightly specialised version of an MVC project.
As a first step, a huge improvement would be to allow running separate PowerShell scripts before and after the install. That way we could simply delete all the files that are ‘ours’ and had not been changed since the last install.
Or delete all the files that are ours, and warn developers that if they have made changes to them then they’ll need to merge back in their own changes using source control. Then the new versions would install automatically.
A nicer solution would be to provide more native support in NuGet for replacing and/or merging content within files in general, in a manner similar to what is allowed for configs only.
Any help, or reassurance of better things to come would be welcome ;-)
Richard Pawson, Naked Objects Group