在TFS在线构建后如何访问工件文件夹? [英] How to access artifacts folder after build in TFS online?
问题描述
PreInfo:我将.net核心Web API(vs2015)与普通项目混合在一起.
PreInfo: I have .net core web api (vs2015) mixed with just ordinary projects.
我已经花了将近2天的时间来使它能够工作和搜索,并尝试了我能想到的一切,但是我实在无法忍受让我在TFS中进行构建和发布以在线玩.
I have spent almost 2 days now to get this to work and search and tried everything I can think of, but I just cant for the live of me get the build and release in TFS online to play together.
构建(发布工件步骤)显示"目录'D:\ a \ 1 \ a'为空.不会添加任何内容来构建工件'drop'."
The build (publish artifact step) says "Directory 'D:\a\1\a' is empty. Nothing will be added to build artifact 'drop'."
但运行点网"步骤显示
发布到D:\ a \ 1 \ s \ Operator \ MobileService \ root \ MobileService \ src \ AMP.Operator.MobileService \ bin \ release \ net452 \ win7-x64 \ publish"
"Published to D:\a\1\s\Operator\MobileService\root\MobileService\src\AMP.Operator.MobileService\bin\release\net452\win7-x64\publish"
...因此它必须在某个地方,该发行版可以将其接收,但是无论我如何尝试,都无法将其接收.
...so it must be somewhere the release can pick it up but no matter what I try I can´t get it to be picked up.
这是我的构建设置
dotnet运行
发布
还有$(System.DefaultWorkingDirectory)/MobileService-Dev的事实请注意,我已经尝试过构建中每个$(build.artifactstagingdirectory)组合的发布,但都没有运气,但是我确定应该指向构建的发布文件夹
And the realse with $(System.DefaultWorkingDirectory)/MobileService-Dev please note that I have tried every combo of $(build.artifactstagingdirectory) in the build to publish without luck but I sure this should point to the publishing folder for the build
我希望有人可以指出解决方案.我只是不明白要完成这项工作有多困难.
I so hope somebody can point me to a solution. I just can´t understand how hard it is to make this work..
推荐答案
在您的构建定义中,我建议添加一个 Copy Files
步骤,该步骤将从您的 msbuild
结果生成到Build的Artifact暂存目录,然后再运行 Publish Artifact
步骤.
Within your build definition, I recommend adding a Copy Files
step that will copy your the build artifacts from your msbuild
results to the Build's Artifact Staging Directory before you run the Publish Artifact
step.
- 源文件夹:
$(Build.SourcesDirectory)
- 内容:
** \ bin \ $(BuildConfiguration)\ **
- 目标文件夹:
$(Build.ArtifactStagingDirectory)
我假设 $(BuildConfiguration)
变量是您定义的自定义变量,并且可能是 Debug
或 Release
.我不确定 Run dotnet 步骤到底做了什么,但是我设置的这个构建定义正确地发布了我的构建工件.我正在运行的发布构建工件"步骤与您执行的步骤相同,除了唯一启用的控制选项是 Enabled
.
I am assuming that the $(BuildConfiguration)
variable is custom to your definition and is probably Debug
or Release
. I am not sure what exactly the Run dotnet step does, but this build definition I setup published my build artifacts correctly. The Publish Build Artifacts step I'm running has the same steps as yours, except the only control option enabled is Enabled
.
我也在TFS 2015更新2上运行.
I am also running on TFS 2015 update 2.
这篇关于在TFS在线构建后如何访问工件文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!