在线构建 TFS 后如何访问 artifacts 文件夹? [英] How to access artifacts folder after build in TFS online?
问题描述
PreInfo:我将 .net core 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:a1a' 为空.将不会添加任何内容来构建工件 'drop'."
The build (publish artifact step) says "Directory 'D:a1a' is empty. Nothing will be added to build artifact 'drop'."
但运行点网"步骤说
发布到 D:a1sOperatorMobileService ootMobileServicesrcAMP.Operator.MobileServicein elease et452win7-x64publish"
"Published to D:a1sOperatorMobileService ootMobileServicesrcAMP.Operator.MobileServicein elease et452win7-x64publish"
...所以它必须在某个地方发行版可以获取它,但无论我尝试什么我都无法获取它.
...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<在您运行
Publish Artifact
步骤之前,/code> 结果到 Build 的 Artifact Staging Directory.
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)
- 内容:
**in$(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 后如何访问 artifacts 文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!