Visual Studio 2022 cannot read Private Nuget Feed

66 views Asked by At

I created an Azure Artifact Nuget feed and I published a library there. Now I want to build a project that references that project. I added the new Package Source in Visual Studio 2022, but when I select my source, the credentials pop up appears, I select my account and this happens

Error in Visual Studio

The error is very generic, even though it says 401. However, the user is the same one I'm using to connect to Azure, so I know it is correct.

I already followed this post but that solution didn't work.

Can I get more details on the error or try a different authentication method to see if it is really an authentication issue?

Thanks

1

There are 1 answers

0
SiddheshDesai On

Refer this MS document to connect Azure Artifact nuget feed to Visual Studio and reference it in your Project.

I select my feed from Artifacts section of my project and select Connect to Feed:-

enter image description here

Now Open Visual Studio > Tools > Options > Nuget Package Manager > Package sources > Add new Package source > In the Name add the name of your Azure Artifacts feed > And Source URL copied from the previous step:-

enter image description here

Now select Nuget Package manager > Manage Nuget package for solution > Select Your Feed > Login to your Azure Devops account which has access to Artifact > and install your private feed package in your project:-

enter image description here

enter image description here

enter image description here

My csproj file:-

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="0004-New-AzureRmVmAvailabilitySetPsg" Version="1.1.0.13" />
    <PackageReference Include="Azure.Data.Tables" Version="12.8.3" />
    <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
  </ItemGroup>

</Project>