Error NU1101: Unable to find package ProjectABC.Core.Services. No packages exist with this id in source(s)

倾然丶 夕夏残阳落幕 提交于 2020-05-15 07:44:05

问题


I am trying to implement CI/CD on Azure DevOps for my Asp.net Core project.

Project having Nuget packages from three different sources:

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/

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:

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

My build pipeline:


回答1:


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

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.



来源:https://stackoverflow.com/questions/56106810/error-nu1101-unable-to-find-package-projectabc-core-services-no-packages-exist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!