VS 2022 on MacOS: Package restore failed

1 Answer 112 Views
General Discussions
Cristian-Leonard
Top achievements
Rank 1
Iron
Cristian-Leonard asked on 18 Jul 2022, 06:35 AM

Hi,

I am trying to add the Xamarin libraries to a project I am working on. I have the Nuget source configured properly: When I search for Telerik libraries they all appear correctly, however they fail to install.

Restoring packages for /******.csproj...
Restoring packages for .NETStandard,Version=v2.1...
  GET https://api.nuget.org/v3-flatcontainer/telerik.ui.for.xamarin.datacontrols.lite/index.json
  NotFound https://api.nuget.org/v3-flatcontainer/telerik.ui.for.xamarin.datacontrols.lite/index.json 306ms
Resolving conflicts for .NETStandard,Version=v2.1...
Unable to find package Telerik.UI.for.Xamarin.DataControls.Lite. No packages exist with this id in source(s): nuget.org
Package restore failed. Rolling back package changes for '****'.
Is this a VS 2022 issue or am I missing something?

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 18 Jul 2022, 11:43 AM

Hi Cristian-Leonard,

The error message occurs as the Telerik references are searched in nuget.org, not in the Telerik NuGet server. 
I have had the same error and I did the following to solve it - removed and added the Telerik NuGet server; restarted the visual studio and mac machine.

Try these steps and let me know whether the issue is solved.

Regards,
Didi
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


Cristian-Leonard
Top achievements
Rank 1
Iron
commented on 18 Jul 2022, 01:57 PM

Did not fix the issue for me: I restarted Mac OS, restarted VS 2022, left only the Telerik nuget source. It is still trying to find the nugets under nuget.org

NotFound https://api.nuget.org/v3-flatcontainer/telerik.ui.for.xamarin.datacontrols.lite/index.json 339ms

Didi
Telerik team
commented on 19 Jul 2022, 06:15 AM

Add a nuget.config file in the project and add the Telerik NuGet server to it.

An example can be found here: https://github.com/LanceMcCarthy/DevOpsExamples/blob/82936bd7d3142c11c34ee65fb0b4f0fddfe38d9a/src/NuGet.Config#L28-L37

 

 
Cristian-Leonard
Top achievements
Rank 1
Iron
commented on 19 Jul 2022, 06:51 AM

Sadly I did not get it working. Updated the nuget.config under ~/.nuget/packages and restarted MacOS. Did not solve the issue.

I did set my real username and password in the xml. Also tried with the nuget.config file in the same folder as my .sln file, nothing.

Didi
Telerik team
commented on 19 Jul 2022, 07:07 AM

Remove the Telerik Nuget Server from the NuGet Package manager in Visual Studio and then add it again. 

I am not sure what else I can suggest. On my side, these steps solved the issue. Check for updates in visual studio for mac, and if there are any install them.

A
Top achievements
Rank 1
commented on 09 Aug 2022, 10:17 AM

Are there any news? I have exactly the same problem and I've tried all the possible fixes you suggested, with no results.
Cristian-Leonard
Top achievements
Rank 1
Iron
commented on 09 Aug 2022, 02:29 PM

I did not manage to fix the issue. Ended up copying the nugets to the solution folder.
Didi
Telerik team
commented on 10 Aug 2022, 07:37 AM

Hi A Villa and Christian-Leonard,

I have tested on my mac machine and I do not have this issue.

I fixed it using the steps I provided in my previous comments. I am not sure why these steps do not work on your side.

Creating a nuget.config in the project folder must solve the issue. The nuget.config file points the project from where the packages must be installed. 

A
Top achievements
Rank 1
commented on 10 Aug 2022, 10:20 AM

In fact this worked for me, thank you.
Tags
General Discussions
Asked by
Cristian-Leonard
Top achievements
Rank 1
Iron
Answers by
Didi
Telerik team
Share this question
or