2
Vote

Package Creation fails due to extra escape character in the formed arguments

description

Getting the below error for simple classlibrary project.
1>------ Build started: Project: ClassLibrary1, Configuration: Debug Any CPU ------
1> ClassLibrary1 -> C:\SVN\New_Training\training01\trunk\VS2013\CSharp\Exercise1\ClassLibrary1\ClassLibrary1\bin\Debug\ClassLibrary1.dll
1> Building NuGet package in Post-Build event...
1> Pre-processing the project file to make sure the assembly exists where NuGet.ex
1> e will expect it to be, started at 14:43:26.3436683.
1> The Output Directory is the same as defined in the project file, so no pre-proc
1> essing actions were required.
1> Pre-processing the project file finished running at 14:43:26.4676683. Completed
1> in 0.124 seconds.
1> VERBOSE: New-NuGetPackage script started running at 14:43:26.5066683.
1> VERBOSE: About to run Pack command '&
1> "C:\SVN\New_Training\training01\trunk\VS2013\CSharp\Exercise1\ClassLibrary1\Cla
1> ssLibrary1\PostBuildScripts\NuGet.exe" pack
1> "C:\SVN\New_Training\training01\trunk\VS2013\CSharp\Exercise1\ClassLibrary1\Cla
1> ssLibrary1\ClassLibrary1.csproj" -OutputDirectory
1> "C:\SVN\New_Training\training01\trunk\VS2013\CSharp\Exercise1\ClassLibrary1\Cla
1> ssLibrary1\bin\Debug" -Properties Configuration="Debug"`;Platform="AnyCPU"
1> -NonInteractive '.
1> VERBOSE:
Runnning the Nuget.Exe command gives the below error.
"C:\SVN\New_Training\training01\trunk\VS2013\CSharp\Exercise1\ClassLibrary1\ClassLibrary1\PostBuildScripts\NuGet.exe" pack "C:\SVN\New_Training\training01\trunk\VS2013\CSharp\Exercise1\ClassLibrary1\ClassLibrary1\ClassLibrary1.csproj" -OutputDirectory "C:\SVN\New_Training\training01\trunk\VS2013\CSharp\Exercise1\ClassLibrary1\ClassLibrary1\bin\Debug" -Properties Configuration="Debug"`;Platform="AnyCPU"
__
Unable to find 'ClassLibrary1.dll'. Make sure the project has been built.__


The reason seems to be escap character in the formed nuget.exe switches... Not sure why that character comes into it? see the line below having extra escap character.

______-Properties Configuration="Debug"`;Platform="AnyCPU"______


Please help

comments

deadlydog wrote Jun 13 at 11:58 PM

Thanks for reporting this. I'll look into it.

patrickb01 wrote Jun 20 at 4:01 PM

I have this problem also - I Initially only had it while trying to run this package from a Jenkins CI server through MSBuild, however in trying to fix that I updated to latest -pre build, and subsequently I had the same problem locally. It appears that with the escape character nothing happens, but without the escape character the script fails because the command is split on the semi-colon (Which is the reason the escape character is there in the first place)

I tried converting the platform/configuration settings into a pair of -prop calls in the script, as opposed to a semi-colon separated properties collection, but that had no impact. I have run the pack command through the command line and it seems to work fine, so I'm not sure what the problem is

deadlydog wrote Jul 8 at 4:32 PM

Hmmmm, are you sure that the backtick (i.e. escape character) is the problem? When I create a new vanilla console app and add the NuGet package everything builds fine, and I can see in the output that the backtick is included. I think that the problem may be something else.

Can you please update the to latest prerelease (1.8.1-Prerelease2) and try again. If you still have the problem then please post the FULL text from the output window, not just a snippet of it. Thanks.

deadlydog wrote Jul 15 at 11:53 PM

Are you still having this problem when using the new 1.8.1 version of the NuGet package? If so, can you please post the entire text from the output window. I am still unable to reproduce the problem.