All Collections
MyGet Help
Build Services
Getting 'The target "Pack" does not exist in the project' in build log
Getting 'The target "Pack" does not exist in the project' in build log
Toshi Dávila avatar
Written by Toshi Dávila
Updated over a week ago

This happens with solutions that combine "traditional" .csproj with the new .csproj format. The reason is for new .csproj we require the "Pack" target to exist (which is always the case for the new .csproj format). In mixed solutions, we default to use the new .csproj format's capabilities for the entire solution.

 

You can simulate the build by invoking MSBuild (example with Community edition) from the command line:

"%programfiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" YourSolution.sln /p:Configuration="Debug" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false /t:Rebuild;Pack /p:IncludeSource=true /p:IncludeSymbols=true /p:GeneratePackageOnBuild=true

 

To solve this issue:

  • Either convert all projects to the new .csproj format

  • Or edit the "classic" .csproj file and add a dummy "Pack" target: <Target Name="Pack"></Target>  

Did this answer your question?