The Nuget Restore from VSO's build pipeline failed due to some nuget packages that are not compatible with netcoreapp2.1
. However, when I looked through all the csproj files in the solution, none of the csproj files have these nuget packages. I might have installed these before but right now it's definitely not here.
Here's the csproj file that is mentioned in the error message.
<ItemGroup>
<PackageReference Include="Microsoft.AspNet.WebApi" Version="5.2.6" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>
Here's the Nuget.Config file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
Please advise how to fix this issue.
EDIT=====================================================
After removing the nuget package from Microsoft.AspNet.WebApi
, the NugetRestore
passed, but Build solution
failed. It shows a different error
[error]C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(208,5):
Error NETSDK1004: Assets file 'd:\agentwrok\18\s....\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
This is the configuration for Build Solution