Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
737 views
in Technique[技术] by (71.8m points)

msbuild - How to access artifacts folder after build in TFS online?

PreInfo: I have .net core web api (vs2015) mixed with just ordinary projects.

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.

The build (publish artifact step) says "Directory 'D:a1a' is empty. Nothing will be added to build artifact 'drop'."

but the "run dot net" step says

"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.

Here is my build setup My build

dotnet run dotnet run

publishing the publish

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 realse

I so hope somebody can point me to a solution. I just can′t understand how hard it is to make this work..

question from:https://stackoverflow.com/questions/41962843/how-to-access-artifacts-folder-after-build-in-tfs-online

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

  • Source Folder: $(Build.SourcesDirectory)
  • Contents: **in$(BuildConfiguration)**
  • Target Folder: $(Build.ArtifactStagingDirectory)

Copy Files Task

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.

I am also running on TFS 2015 update 2.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...