0

I recently transferred a Xamarin project to a new MacBook in order to get everything up to date to the latest iOS version. I am using Visual Studio for Mac 2022.

This project uses Grial UI(version 3) and Telerik for Xamarin Forms which require configuring custom Nuget sources.

I have ran into two problems:

  1. The sources tell me I have "Invalid Credentials" when adding them even though they are correct and I can browse the packages when selecting the source.
  2. When attempting to restore the packages, it uses Nuget.org instead of the proper source. Here is one error it gets:

Unable to find package UXDivers.Grial. No packages exist with this id in source(s): nuget.org

It is supposed to be using the custom Grial Nuget source that I have added, not nuget.org.

Number 1. might be a non-issue but maybe indicates something else is configured wrong, but 2 makes me unable to build the project at all because these references aren't used.

I have also tried to update the packages using Nuget package manager which detects the current version and available versions successfully and it fails for the same reason(using the wrong source when doing the actual update).

Any suggestions on how to fix this? My Nuget sources are configured in the exact same way on my older(mid-2015) Mac and it is working with VS for Mac 2019.

rgorr
  • 331
  • 3
  • 18
  • This appears to be a bug. Downgrading to Visual Studio 2019 for mac and then updating it to 2022 fixed the issue for me. – rgorr May 04 '23 at 14:33

1 Answers1

0

I had the same problem. On my MacBookAir everything worked fine (bought in november 2022), now i got a MacBookPro from work. I installed everything but when it came to running my Xamarin project, restoring the project always failed.

In the package console output i found that the only used feeds were

https://api.nuget.org/v3/index.json

Randomly but luckily i found a link to the microsoft documentation. (https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior). I checked my NuGet.config file on my MacBookPro and MacBookAir. And there was the error. I don´t know why but when i added my grial-resource to the nuget sources, it did not update my NuGet.config file.

So my NuGet.config file looked like that

<?xml version="1.0" encoding="utf-8"?>
<configuration>
   <packageSources>
      <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
   </packageSources>
</configuration>

While on my MacBookAir it looked like that

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="grial" value="http://nuget.uxdivers.com/grial" />
  </packageSources>
  <packageSourceCredentials>
    <grial>
        <add key="Username" value="yourUsername" />
        <add key="ClearTextPassword" value="yourPassword" />
    </grial>
  </packageSourceCredentials>
</configuration>  

So to fix the problem on my MacBookPro i added the grial source to the file, saved it and restarted VSforMac. Now i can build my project on both my MacBooks.

grabnerM
  • 3
  • 3