I've read the following post about this problem, but with my solution and nuget file are located in the same folder, the task dotnet build fails, while the previous dotnet restore succeed.
I have no HintPath in my project, just direct references to Packages.
What is confusing to me is that somehow, the restore task is trying to look at .net core 5 assemblies in my private nuget feed (Azure Artifacts). For instance:
GET https://pkgs.dev.azure.com/mycompany/_packaging/58afa52a-c2d4-4346-bfd2-1bf77f29075e/nuget/v3/flat2/system.servicemodel.security/index.json
Unauthorized https://pkgs.dev.azure.com/mycompany/_packaging/58afa52a-c2d4-4346-bfd2-1bf77f29075e/nuget/v3/flat2/system.servicemodel.duplex/index.json 52ms
It seems that nuget.org is simply ignored.
Following is the content of my nuget.config and project file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear/>
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="Dev" value="https://pkgs.dev.azure.com/rtetech/_packaging/Dev/nuget/v3/index.json" />
</packageSources>
</configuration>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AssemblyVersion>0.0.4</AssemblyVersion>
<FileVersion>0.0.4</FileVersion>
<RootNamespace>MyCompany.Common</RootNamespace>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>0.0.4-pre</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommonDatabase.EFCore" Version="1.4.10" />
<PackageReference Include="CryptographyTools.Portable" Version="2.0.4" />
<PackageReference Include="Dapper.StrongName" Version="1.50.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="MyCompanyLog.Standard" Version="1.3.3" />
<PackageReference Include="System.ServiceModel.Duplex" Version="4.8.*" />
<PackageReference Include="System.ServiceModel.Federation" Version="4.8.*" />
<PackageReference Include="System.ServiceModel.Http" Version="4.8.*" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="4.8.*" />
<PackageReference Include="System.ServiceModel.Security" Version="4.8.*" />
</ItemGroup>
</Project>