私のCIビルドには、リリースビルドを.\.output\_Build
フォルダーに出力するMSBuildがあります。この場合、このフォルダーには、nupkg にパッケージ化する exe があります。
私が実行すると:
NuGet.exe pack -Version "0.1.0" -BasePath ".\.output\_Build" -OutputDirectory ".\.output\Packages\NuGet" ".\src\Project\Project.csproj" -Symbols -verbosity detailed -tool
のフォルダBasePath
です。私は得る:OutputPath
msbuild -OutputPath
Attempting to build package from 'Project.csproj'.
MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
NuGet.CommandLineException: Unable to find 'c:\project\src\.out\Debug\Project.exe'. Make sure the project has been built.
at NuGet.CommandLine.ProjectFactory.BuildProject()
at NuGet.CommandLine.ProjectFactory.CreateBuilder(String basePath)
at NuGet.CommandLine.PackCommand.BuildFromProjectFile(String path)
at NuGet.CommandLine.PackCommand.BuildPackage(String path)
at NuGet.CommandLine.PackCommand.ExecuteCommand()
at NuGet.CommandLine.Command.ExecuteCommandAsync()
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
これは、nuget が csproj からデバッグ構成の OutputDirectory を読み取り、パッケージ化するものを正しく見つけられなかったことを示唆しているようです。-BasePath
パラメータがアーティファクトを探す場所を教えてくれると思っていましたが、そうではないようです。パッケージ化にcsprojファイルを使用するときに、csprojのパスをたどらないようにnugetに指示するにはどうすればよいですか? パックには csproj ファイルを使用する必要があります。