错误NU1101:无法找到包ProjectABC.Core.Services.源中不存在具有此ID的软件包 [英] Error NU1101: Unable to find package ProjectABC.Core.Services. No packages exist with this id in source(s)

查看:1704
本文介绍了错误NU1101:无法找到包ProjectABC.Core.Services.源中不存在具有此ID的软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的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:

错误NU1101:无法找到包abc.Core.Services.没有包裹 源中存在具有此id的源:Microsoft Visual Studio脱机 软件包nuget.org

Error NU1101: Unable to find package abc.Core.Services. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget.org

我的构建管道:

推荐答案

您需要创建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的软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆