Update-Package fails if build folder included

Topics: General
Sep 4, 2013 at 3:14 PM
In the package that I've created, I've included the Build folder so that I can provide a .props and .targets file for our users.

Now, when I upgrade that package, I get the following error.

The imported project "D:\temp\Test\packages\MyPackage.6.2.28\build\net40\MyPackage.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. D:\temp\Test\Training.Site\Training.Site.csproj

Now, at the point that I get this error, the whole folder D:\temp\Test\packages\MyPackage.6.2.28\ does not exist. I'm not sure if it ever existed or if it's already done a rollback.

I do get prompted during install that there was a file conflict (do I want to overwrite a file). When that question is on the screen, there is no MyPackage.6.2.28 folder present, not sure if it ever was.

Any help would be appreciated.

Oh, just to add: everything works beautifully if the Build folder isn't included in the package.
Sep 4, 2013 at 3:28 PM
Edited Sep 4, 2013 at 3:31 PM
Hmm, is it maybe because the .csproj file is upgraded to the point to the new version of the package (6.2.28 instead of 6.2.27) but the 6.2.28 folder does not exist yet?

So what I imagine happens: the nuget package gets loaded into memory and starts upgrading files. THEN when that is done it validates the .csproj file and then finally it writes the contents of the package in the appropriate folder in packages? Something like that? I'm just guessing here, I really need to understand how to debug this better.

It should be noted that I'm trying to do the upgrade using nuget.exe on the command-line. When doing this from within Visual Studio it works well.
..\.nuget\NuGet.exe sources Add -Name LocalMachine -Source D:\Dropbox\Dev\MyPackage\build
..\.nuget\NuGet.exe update %CD%\packages.config -Id MyPackage