我有一个dotnet核心库,我试图发布到我的VSTS托管的Nuget Feed。我有一个问题,它似乎没有做任何事情。构建完成没有错误,但nupkg文件似乎既没有创建也没有推送。下面的构建日志包含一个错误,因为我试图将输出发布为构建资产,但没有要发布的输出...
(为了简洁,记录开始中断)
****************************************************************************** Starting: NuGet pack ****************************************************************************** ============================================================================== Task : NuGet Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. Version : 2.0.3 Author : Microsoft Corporation Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747) ============================================================================== Downloading: https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe Caching tool: NuGet 4.0.0 x64 Using version: 4.0.0 Found tool in cache: NuGet 4.0.0 x64 C:\Windows\system32\chcp.com 65001 Active code page: 65001 ****************************************************************************** Finishing: NuGet pack ****************************************************************************** ****************************************************************************** Starting: NuGet push ****************************************************************************** ============================================================================== Task : NuGet Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. Version : 2.0.3 Author : Microsoft Corporation Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747) ============================================================================== C:\Windows\system32\chcp.com 65001 Active code page: 65001 ****************************************************************************** Finishing: NuGet push ****************************************************************************** ****************************************************************************** Starting: Publish Artifact: Nuget Packages ****************************************************************************** ============================================================================== Task : Publish Build Artifacts Description : Publish Build artifacts to the server or a file share Version : 1.0.42 Author : Microsoft Corporation Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=708390) ============================================================================== Publish build artifacts failed with error: Not found PathtoPublish: d:\a\1\a\*.nupkg ****************************************************************************** Finishing: Publish Artifact: Nuget Packages ****************************************************************************** ****************************************************************************** Starting: Post Job Cleanup ****************************************************************************** Cleaning any cached credential from repository: Esoterix (Git) git remote set-url origin https://esoterix.visualstudio.com/_git/Esoterix git remote set-url --push origin https://esoterix.visualstudio.com/_git/Esoterix ****************************************************************************** Finishing: Post Job Cleanup ****************************************************************************** ****************************************************************************** Finishing: Build ******************************************************************************
该库是一个使用.NetCoreApp 1.1的.net核心库
构建定义遵循使用...
成功运行的dotnet测试NUGET PACK
要打包的文件的路径:** / src / * .csproj
配置:$(BuildConfiguration)
包文件夹:$(Build.ArtifactStagingDirectory)
NUGET PUSH
推送包的路径:$(Build.ArtifactStagingDirectory)/ * .nupkg
目标Feed:本地(我的VSTS套餐Feed)
这看起来很奇怪......
C:\Windows\system32\chcp.com 65001
Active code page: 65001
答案 0 :(得分:1)
对于.NET核心库项目,.csproj
文件通常存在于**/src/ProjectName/ProjectName.csproj
中。
因此,请在 Nuget pack 步骤中查看 csproj或nuspec文件的路径,它主要应为**/src/ProjectName/*.csproj
或{{1 }}。或者,如果您只有一个项目,则可以直接使用**/src/*/*.csproj
。