Forum Discussion
atlasfoo
Jul 11, 2024Copper Contributor
Configuring nuget azure artifacts source in MacOS
Greetings. In my company, we are using Azure Artifacts in an Azure Devops Server 2019 on premise instance as an internal package source, and we are trying to work in a .net core project in a MacOS...
chamindac
Jul 24, 2024Brass Contributor
atlasfoo have you tried using a nuget.config in your project. That makes it work for all platforms. Windows, Linux and in MacOS.
Make sure to replace https://pkgs.dev.azure.com/chamindac/_packaging/ChFeed2/nuget/v3/index.json with your artifact feed and replace %System.AccessToken% with your PAT
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<!-- Allow NuGet to download missing packages -->
<add key="enabled" value="True" />
<!-- Automatically check for missing packages during build in Visual Studio -->
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<clear />
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
<add key="my-devops-feed" value="https://pkgs.dev.azure.com/chamindac/_packaging/ChFeed2/nuget/v3/index.json" />
</packageSources>
<activePackageSource>
<!-- All non-disabled sources are active -->
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<packageSourceCredentials>
<my-devops-feed>
<add key="Username" value="AzDOPAT" />
<add key="ClearTextPassword" value="%System.AccessToken%" />
</my-devops-feed>
</packageSourceCredentials>
</configuration>