本文介绍了使用MSBuild和VS Team Services创建NuGet程序包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2015,从过去的几天开始,我试图创建在Visual Studio Team Services(以前是Visual Studio Online)上托管的nuget程序包,并在每次构建项目时创建该程序包,但均未成功.有人可以逐步提供有关如何完成此任务的介绍.我非常感谢你.

I am using visual studio 2015, from past few days I was trying to create nuget package that are hosted on Visual Studio Team Services (previously Visual Studio Online) and created every time a project is build, but with no success. Can someone please provide step by step intro to how to achieve this task. I am very thankful to you.

推荐答案

以下是一个简单的构建定义,用于创建nuget程序包并将该程序包发布到VSTS托管的程序包服务:

Following is a simple build definition to create nuget package and publish the package to VSTS hosted package service:

  1. 在VSTS中创建构建定义以构建项目.
  2. 在构建定义中添加"NuGet Packager"任务以创建Nuget包.我使用项目文件生成nuget包,因此将路径设置为"NugetP.csproj".
  3. 添加"NuGet发布者"任务以将该包发布到Feed.由于我使用VSTS托管的程序包供稿,因此选择内部NuGet供稿",然后在内部供稿URL"中输入nuget供稿URL.
  4. 保存构建定义并排队新的构建. nuget包将被创建并推送到提要.
  1. Create a build definition in VSTS to build the project.
  2. Add "NuGet Packager" task in the build definition to create the Nuget package. I use project file to generate the nuget package, so set the path to "NugetP.csproj".
  3. Add "NuGet Publisher" task to publish the package to Feed. Since I use the VSTS hosted package feed, so choose "Internal NuGet Feed", and enter the nuget feed URL in "Internal Feed URL".
  4. Save the build definition and queue a new build. The nuget package will be created and pushed to the feed.

这篇关于使用MSBuild和VS Team Services创建NuGet程序包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 02:02