This project has moved. For the latest updates, please go here.
2

Closed

Getting "Could not determine where NuGet Package was created to" error when using custom .nuspec

description

I am using CreateNewNuGetPackageFromProjectAfterEachBuild and just updated from v1.8.8 to v1.8.9, and I now get the error:

"Could not determine where NuGet Package was created to. This typically means that an error occurred while NuGet.exe was packing it. Look for errors from NuGet.exe above (in the console window), or in the following NuGet.exe output. You can also try running this command with the -Verbose switch for more information:"

The project has a .nuspec file with some basic info (perhaps there is a way to specify this in Config.ps1):
<?xml version="1.0"?>
<package>
    <metadata>
        <id>MyFramework_Basic</id>
        <title>My Framework (Basic)</title>
        <version>$version$</version>
        <authors>My Software, Inc.</authors>
        <owners>My Software, Inc.</owners>
        <requireLicenseAcceptance>false</requireLicenseAcceptance>
        <description>The My Framework contains classes and controls common to My Software products.  This version omits dlls used for WinForms or WPF applications.</description>
        <copyright>Copyright My Software, Inc.</copyright>
    </metadata>
    <files/>
</package>
While this worked fine in v1.8.8, when I add a .nuspec file to a sample project running v1.8.9 it begins to fail. What can I do?
Closed Apr 13 at 5:52 AM by deadlydog
The new New-NuGetPackage.ps1 v1.5.8 (and CreateNewNuGetPackageFromProjectAfterEachBuild NuGet package v1.8.10) now includes the required -ForceEnglishOutput parameter to NuGet.exe, so this problem should be resolved. NOTE: The -ForceEnglishOutput parameter is only supported by NuGet.exe v3.5.0+, so be sure you are using at least that version of the NuGet.exe.

comments

deadlydog wrote May 30, 2016 at 3:49 PM

If you check the "Output" pane in Visual Studio it should give you much more information, including the error message (if any) that was output by NuGet.exe. Could you check that please, and if it's still not obvious what the problem is, paste that Output text here.

sparticus1701 wrote May 30, 2016 at 5:22 PM

Here is part 1 of the output:
------ Build started: Project: ZNuGet.SSIFramework.Basic, Configuration: Release Any CPU ------
Build started 5/30/2016 11:18:38 AM.
PreBuildEvent:
  if exist D:\Development\SSIFramework\Release\SSIFramework_Basic.*.nupkg del D:\Development\SSIFramework\Release\SSIFramework_Basic.*.nupkg
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
  C:\Program Files (x86)\MSBuild\14.0\bin\csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE /errorendlocation /preferreduilang:en-US /highentropyva+ /reference:D:\Development\SSIFramework\Release\ACBCAnalysis.dll /reference:D:\Development\SSIFramework\Release\CBCAnalysis.dll /reference:D:\Development\SSIFramework\Release\CBCData.dll /reference:D:\Development\SSIFramework\Release\LegacyData.dll /reference:D:\Development\SSIFramework\Release\MaxDiffAnalysis.dll /reference:D:\Development\SSIFramework\Release\MaxDiffDesign.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\mscorlib.dll" /reference:D:\Development\SSIFramework\Release\SSIAnalysis.dll /reference:D:\Development\SSIFramework\Release\SSIApplication.dll /reference:D:\Development\SSIFramework\Release\SSIData.dll /reference:D:\Development\SSIFramework\Release\SSILicensing.dll /reference:D:\Development\SSIFramework\Release\SSISim.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.dll" /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\ZNuGet.SSIFramework.Basic.dll /ruleset:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset" /subsystemversion:6.00 /target:library /utf8output CommonAssemblyInfo.cs Properties\AssemblyInfo.cs "C:\Users\walt\AppData\Local\Temp\.NETFramework,Version=v4.6.1.AssemblyAttributes.cs" obj\Release\\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs obj\Release\\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs obj\Release\\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
  Using shared compilation with compiler from directory: C:\Program Files (x86)\MSBuild\14.0\bin
CopyFilesToOutputDirectory:
  Copying file from "obj\Release\ZNuGet.SSIFramework.Basic.dll" to "..\Release\ZNuGet.SSIFramework.Basic.dll".
  ZNuGet.SSIFramework.Basic -> D:\Development\SSIFramework\Release\ZNuGet.SSIFramework.Basic.dll
  Copying file from "obj\Release\ZNuGet.SSIFramework.Basic.pdb" to "..\Release\ZNuGet.SSIFramework.Basic.pdb".
PostBuildEvent:
  REM Create a NuGet package for this project and place the .nupkg file in the project's output directory.
  REM If you see this in Visual Studio's Error List window, check the Output window's Build tab for the actual error.
  ECHO Creating NuGet package in Post-Build event...
  PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'D:\Development\SSIFramework\ZNuGet.SSIFramework.Basic\_CreateNewNuGetPackage\DoNotModify\CreateNuGetPackage.ps1' -ProjectFilePath 'D:\Development\SSIFramework\ZNuGet.SSIFramework.Basic\ZNuGet.SSIFramework.Basic.csproj' -OutputDirectory 'D:\Development\SSIFramework\Release\' -BuildConfiguration 'Release' -BuildPlatform 'AnyCPU'"
  Creating NuGet package in Post-Build event...
  ProjectFilePath parameter value passed to script is 'D:\Development\SSIFramework\ZNuGet.SSIFramework.Basic\ZNuGet.SSIFramework.Basic.csproj'.
  OutputDirectory parameter value passed to script is 'D:\Development\SSIFramework\Release\'.
  BuildConfiguration parameter value passed to script is 'Release'.
  BuildPlatform parameter value passed to script is 'AnyCPU'.
  Using default Version Number value.
  Using default Release Notes value.
  Using user-specified Configuration value 'Release'.
  Using user-specified Platform value 'AnyCPU'.
  Using user-specified Pack Properties value 'TargetFrameworkVersion=v4.6.1;Optimize=true;'.
  Using user-specified Pack Options value '-Symbols -IncludeReferencedProjects -Exclude **\ZNuGet.SSIFramework.*'.
  Pre-processing the project file to make sure the assembly exists where NuGet.exe will expect it to be, started at 11:18:40.3227276.
  The proper assembly already exists where NuGet.exe will expect it to be, so no pre-processing actions were required.
  Pre-processing the project file finished running at 11:18:40.3966754. Completed in 0.0739478 seconds.
  VERBOSE: New-NuGetPackage script started running at 11:18:40.5116825.
  VERBOSE: Using PowerShell Version: 5.0.10586.122.
  VERBOSE: About to run Help command '& 
  "D:\Development\SSIFramework\ZNuGet.SSIFramework.Basic\_CreateNewNuGetPackage\DoNotModify\NuGet.exe"'.
  VERBOSE: Using NuGet Version: 3.3.0.212.
  VERBOSE: About to run Pack command '& 
  "D:\Development\SSIFramework\ZNuGet.SSIFramework.Basic\_CreateNewNuGetPackage\DoNotModify\NuGet.exe" pack 
  "D:\Development\SSIFramework\ZNuGet.SSIFramework.Basic\ZNuGet.SSIFramework.Basic.csproj" -OutputDirectory 
  "D:\Development\SSIFramework\Release" -Properties 
  Configuration="Release"`;Platform="AnyCPU"`;TargetFrameworkVersion=v4.6.1`;Optimize=true -NonInteractive -Symbols 
  -IncludeReferencedProjects -Exclude **\ZNuGet.SSIFramework.*'.
  A stable release of a package should not have on a prerelease dependency. Either modify the version spec of dependency "Antlr4.Runtime (≥ 4.5-alpha003)" or update the version field.
  VERBOSE: MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
  
  Attempting to build package from 'ZNuGet.SSIFramework.Basic.csproj'.
  
  Packing files from 'D:\Development\SSIFramework\Release'.
  
  Using 'ZNuGet.SSIFramework.Basic.nuspec' for metadata.
  
  Found packages.config. Using packages listed as dependencies
  
  Found packages.config. Using packages listed as dependencies
  
  Found packages.config. Using packages listed as dependencies
  
  Found packages.config. Using packages listed as dependencies

sparticus1701 wrote May 30, 2016 at 5:22 PM

Here is part 2 of the output:
  Found packages.config. Using packages listed as dependencies
  VERBOSE: Performing any required New-NuGetPackage script cleanup...
  An error occurred while running New-NuGetPackage script:
  Could not determine where NuGet Package was created to. This typically means that an error occurred while NuGet.exe was packing it. Look for errors from NuGet.exe above (in the console window), or in the following NuGet.exe output. You can also try running this command with the -Verbose switch for more information:
  MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
  Attempting to build package from 'ZNuGet.SSIFramework.Basic.csproj'.
  Packing files from 'D:\Development\SSIFramework\Release'.
  Using 'ZNuGet.SSIFramework.Basic.nuspec' for metadata.
  Found packages.config. Using packages listed as dependencies
  Found packages.config. Using packages listed as dependencies
  Found packages.config. Using packages listed as dependencies
  Found packages.config. Using packages listed as dependencies
  Found packages.config. Using packages listed as dependencies
  
  Could not determine where NuGet Package was created to. This typically means that an error occurred while NuGet.exe 
  was packing it. Look for errors from NuGet.exe above (in the console window), or in the following NuGet.exe output. 
  You can also try running this command with the -Verbose switch for more information:
  MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
  Attempting to build package from 'ZNuGet.SSIFramework.Basic.csproj'.
  Packing files from 'D:\Development\SSIFramework\Release'.
  Using 'ZNuGet.SSIFramework.Basic.nuspec' for metadata.
  Found packages.config. Using packages listed as dependencies
  Found packages.config. Using packages listed as dependencies
  Found packages.config. Using packages listed as dependencies
  Found packages.config. Using packages listed as dependencies
  Found packages.config. Using packages listed as dependencies
  At D:\Development\SSIFramework\ZNuGet.SSIFramework.Basic\_CreateNewNuGetPackage\DoNotModify\New-NuGetPackage.ps1:1222 
  char:7
  +             throw "Could not determine where NuGet Package was create ...
  +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : OperationStopped: (Could not deter...as dependencies:String) [], RuntimeException
      + FullyQualifiedErrorId : Could not determine where NuGet Package was created to. This typically means that an err 
     or occurred while NuGet.exe was packing it. Look for errors from NuGet.exe above (in the console window), or in th  
    e following NuGet.exe output. You can also try running this command with the -Verbose switch for more information:   
   
  MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
  Attempting to build package from 'ZNuGet.SSIFramework.Basic.csproj'.
  Packing files from 'D:\Development\SSIFramework\Release'.
  Using 'ZNuGet.SSIFramework.Basic.nuspec' for metadata.
  Found packages.config. Using packages listed as dependencies
  Found packages.config. Using packages listed as dependencies
  Found packages.config. Using packages listed as dependencies
  Found packages.config. Using packages listed as dependencies
  Found packages.config. Using packages listed as dependencies
   
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command "REM Create a NuGet package for this project and place the .nupkg file in the project's output directory.
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: REM If you see this in Visual Studio's Error List window, check the Output window's Build tab for the actual error.
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: ECHO Creating NuGet package in Post-Build event...
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'D:\Development\SSIFramework\ZNuGet.SSIFramework.Basic\_CreateNewNuGetPackage\DoNotModify\CreateNuGetPackage.ps1' -ProjectFilePath 'D:\Development\SSIFramework\ZNuGet.SSIFramework.Basic\ZNuGet.SSIFramework.Basic.csproj' -OutputDirectory 'D:\Development\SSIFramework\Release\' -BuildConfiguration 'Release' -BuildPlatform 'AnyCPU'"" exited with code 1.

Build FAILED.

Time Elapsed 00:00:03.86
========== Build: 0 succeeded, 1 failed, 11 up-to-date, 0 skipped ==========

deadlydog wrote May 31, 2016 at 6:55 PM

Is the NuGet package actually getting built to the "D:\Development\SSIFramework\Release" directory?

If not, I suspect the problem is:
A stable release of a package should not have on a prerelease dependency. Either modify the version spec of dependency "Antlr4.Runtime (≥ 4.5-alpha003)" or update the version field.
I hope that helps.

sedlmeier wrote Jul 27, 2016 at 1:19 PM

In my case i had to fix the $NUGET_EXE_SUCCESSFULLY_CREATED_PACKAGE_MESSAGE_REGEX (line 297) regex. The script checks the output of the nuget.exe-packaging-command. If the output does match the specified regex, everything is ok, but if not you get this error.

The german output of nuget.exe is Das Paket "<FilePath>" wurde erfolgreich erstellt. but the script expects a string like Successfully created package "<FilePath>". instead.

jwezel wrote Aug 2, 2016 at 4:23 PM

This ticket (issued because of the German output of NuGet) seems to be a duplicate of https://newnugetpackage.codeplex.com/workitem/35.

Please find workaround as well as proposed patch at https://newnugetpackage.codeplex.com/workitem/35

Necroman wrote Sep 27, 2016 at 8:31 AM

Same problem here. I was able to find the root cause - if there is other Language set as the system default, then NuGet uses localized messages and the package creation fails because the check for excat success string fails.
Possible solution:
  • force English culture in NuGet.exe, if this is possible?
  • use check for localized success messages or generic success state?

jwezel wrote Sep 27, 2016 at 9:46 AM

Recommended solution:
definitely force English culture in NuGet.exe!

BUT: there is some progress required at NuGet.exe
The positive point: it's already in progress, but still needs to be completed in full:

See also: https://github.com/NuGet/NuGet.Client/pull/451

deadlydog wrote Jan 23 at 2:06 AM

The new New-NuGetPackage.ps1 v1.5.8 now includes the required -ForceEnglishOutput parameter to NuGet.exe, so this problem should be resolved. NOTE: The -ForceEnglishOutput parameter is only supported by NuGet.exe v3.5.0+, so be sure you are using at least that version of the NuGet.exe.

If you could try the new version of the script and NuGet.exe and let me know that it does indeed work as expected, I would appreciate that. Thanks.

deadlydog wrote Jan 23 at 2:40 AM

I believe this problem should now be solved using the CreateNewNuGetPackageFromProjectAfterEachBuild NuGet package v1.8.10 or greater. Can you please give it a try and let me know if it now works as expected. Thanks.