0

Our build pipeline has been working fine, producing and saving packages to our Azure DevOps artifact feed. Although, we recently started seeing a strange failure in Visual Studio 2019 when trying to upgrade one of the packages to the latest version per to the following screenshot:

enter image description here

As the screenshot depicts, the package version 1.0.1-preview4 does exist but the project is not upgraded to it and version 1.0.1-preview3 has to be picked up instead to upgrade! Any idea what the root cause of this issue is and how to address this problem?

Arash
  • 3,628
  • 5
  • 46
  • 70

2 Answers2

0

I run into this issue quite frequently and it is caused by Caching. Clearing your Nuget Cache will resolve the issue. See this StackOverflow post:

Package is not found in the following primary source

Chris
  • 1
0

Apart from cleaning the cache, also check if the version 1.0.1-preview4 is valid(unlisted or deleted?) in your list.

enter image description here

Then use the filter to locate the View of the 1.0.1-preview4 package. Determine the view it belongs to, @Local, @Prerelease or @Release. After that go feed settings=>Views to check the related permissions:

enter image description here

Make sure your local account has the permission to the View the 1.0.1-preview4 package belongs to.

LoLance
  • 25,666
  • 1
  • 39
  • 73
  • I exhausted all the methods you suggested but the issue still persists. @lance – Arash Apr 30 '20 at 12:14
  • There has to be a delay in populating packages on the feed. Right now 1.0.1-preveiew5 is available to upgrade to while 1.0.1-preview6, 1.0.1-preview7, 1.0.1-preview8 and 1.0.1-preview9 are seen in the feed but not available to upgrade to in VS 2019! – Arash Apr 30 '20 at 13:00
  • @Arash Which way do you use to publish this package to Azure Devops Artifact? I do know some scenarios in which there are several minutes(5~15) delay, but I can't reproduce same issue in my test. I use nuget publish task in pipeline to publish the package, maybe you use local nuget.exe command? – LoLance May 01 '20 at 01:39
  • I am using nuget publish task in pipeline. It's past 24 hours from publishing the newest package but I am still unable to upgrade the package. Not sure what else can contribute in this problem. The interesting point is we have another package in that artifact feed which can be upgraded easily but not this particular one! – Arash May 01 '20 at 11:28
  • Li-MSF any thoughts on my last comment? – Arash May 06 '20 at 11:28
  • The issue is that the build pipeline has built version 18 but the artifact feed shows the latest version as version 9. I do not understand why this happens and how to address this situation! @Lance Li-MSFT – Arash May 06 '20 at 18:17
  • Sorry for the delay but I can't reproduce same issue on my side. Do you mean in web portal UI, the latest version you see is 9 while you have built the 18? But do you add nuget publish task in pipeline to automatically publish that package? Could you please share the content of your pipeline to let me understand your pipeline. – LoLance May 07 '20 at 00:59
  • I think I figured out why this issue happens. The reason could be due to a third party library that causes conflict in a Microsoft's nuget package. Our code is using the latest version of the Microsoft's library but the 3rd party library is using an older version. This theory is yet to be validated some time next week. I will update you once I conclude something firm. Thanks though. – Arash May 07 '20 at 12:15
  • You're welcome. Don't forget to add your solution as answer once you have a clear workaround for that. – LoLance May 08 '20 at 01:02
  • the issue that I explained in my previous post is not the case. The issue still persists after eliminating the 3rd party library. I tried to restore the packages on a another instance of VS 2019 on a different machine but VS 2019 still exhibits the same problem! I really don't know what else can be the root cause! Could you please share your email address so I communicate further privately? Thanks. – Arash May 11 '20 at 19:19
  • Sorry but due to our company's policy, I can't share the personal email address. Maybe you can try several clean steps to check if the issue only occurs for specific project. For me in local machine: 1. Create library project=>generate the nupkg, publish the nupkg to artifact feed 2.In cloud I create new feed to host the package 3. Use a brand new machine(with vs installed) to connect to the feed and consume the feed 4. Update the package locally and publish latest version 5. Go to another machine to edit the project file there so that the project will try to find latest version of the package – LoLance May 12 '20 at 06:10
  • I did the similar tests several times but it all work well... So I think maybe you can follow my steps to check if the issue occurs again. (with new project, new package to do the test) – LoLance May 12 '20 at 06:12