Msbuild 从csproj获取Nuget包现有版本

Msbuild 从csproj获取Nuget包现有版本,msbuild,nuget,nuget-package,csproj,nuspec,Msbuild,Nuget,Nuget Package,Csproj,Nuspec,在我的CI构建中,我有一个MSBuild,它将发布构建输出到\.output\\u build文件夹中;在本例中,此文件夹包含我要打包到nupkg中的exe 当我执行: NuGet.exe pack -Version "0.1.0" -BasePath ".\.output\_Build" -OutputDirectory ".\.output\Packages\NuGet" ".\src\Project\Project.csproj" -Symbols -verbosity detailed

在我的CI构建中,我有一个MSBuild,它将发布构建输出到
\.output\\u build
文件夹中;在本例中,此文件夹包含我要打包到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
msbuild-OutputPath
中的
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文件进行打包时,如何告诉nuget不要遵循csproj中的路径?我必须使用csproj文件进行打包