问题描述
我正在尝试为我的Asp.net Core项目在Azure DevOps上实现CI/CD.
I am trying to implement CI/CD on Azure DevOps for my Asp.net Core project.
具有来自三个不同来源的Nuget软件包的项目:
Project having Nuget packages from three different sources:
Azure Pipeline中的MSBUild将仅在Offline Packages或Nuget.org中找到nuget软件包,但不会找到我也在使用的外部源: http://dev-abc-api-nugetserver-wi.azurewebsites.net /nuget/
MSBUild in Azure Pipeline is going to find nuget packages in Offline Packages or Nuget.org only but not going to find external source which i am also using:http://dev-abc-api-nugetserver-wi.azurewebsites.net/nuget/
我已经在Azure Pipeline Build中尝试了以下代码,但这没用
I have tried below code in Azure Pipeline Build but that didn't work
/p:RestoreAdditionalSources="http://dev-abc-api-nugetserver-wi.azurewebsites.net/nuget/" /t:Rebuild
但仍然收到相同的错误:
But still receiving same error:
我的构建管道:
推荐答案
您需要创建nuget.config
文件(并提交/签入您的项目),在该文件中,您需要指定NuGet源(包括外部源) ).
You need to create nuget.config
file (and commit/check in to your project), in the file you need specify your NuGet sources (include your external source).
在构建管道中,使用resotre
命令添加.Net核心任务,指定您的.csproj
文件并检查"Feeds in my NuGet config",使用用户名&创建一个NuGet端点.您的外部nuget存储库的密码.
In your build pipeline add .Net core task with the resotre
command, specify your .csproj
file and check the "Feeds in my NuGet config", create a NuGet endpoint with username & password for your external nuget repo.
完成此任务后,应下载所有软件包,并成功运行构建.
After this task all your packages should be downloaded and the build should be run successfully.
这篇关于错误NU1101:无法找到包ProjectABC.Core.Services.源中不存在具有此ID的软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!