2

I'm making a basic console Application in .NET Core and when I try to run the command "dotnet build -c release -r win10-x64" I get this:

Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Retrying 'FindPackagesByIdAsyncCore' for source 'http://packagesource/FindPackagesById()?id='Microsoft.NETCore.App.Runtime.win-x64'&semVerLevel=2.0.0'.
  No such host is known.
  Retrying 'FindPackagesByIdAsyncCore' for source 'http://packagesource/FindPackagesById()?id='Microsoft.WindowsDesktop.App.Runtime.win-x64'&semVerLevel=2.0.0'.
  No such host is known.
  Retrying 'FindPackagesByIdAsyncCore' for source 'http://packagesource/FindPackagesById()?id='Microsoft.AspNetCore.App.Runtime.win-x64'&semVerLevel=2.0.0'.
  No such host is known.
  Retrying 'FindPackagesByIdAsyncCore' for source 'http://packagesource/FindPackagesById()?id='Microsoft.NETCore.App.Runtime.win-x64'&semVerLevel=2.0.0'.
  No such host is known.
  Retrying 'FindPackagesByIdAsyncCore' for source 'http://packagesource/FindPackagesById()?id='Microsoft.WindowsDesktop.App.Runtime.win-x64'&semVerLevel=2.0.0'.
  No such host is known.
  Retrying 'FindPackagesByIdAsyncCore' for source 'http://packagesource/FindPackagesById()?id='Microsoft.AspNetCore.App.Runtime.win-x64'&semVerLevel=2.0.0'.
  No such host is known.
C:\Program Files\dotnet\sdk\3.1.201\NuGet.targets(124,5): error : Failed to retrieve information about 'Microsoft.NETCore.App.Runtime.win-x64' from remote source 'http://packagesourc
e/FindPackagesById()?id='Microsoft.NETCore.App.Runtime.win-x64'&semVerLevel=2.0.0'. [C:\Users\steve\PlatziCSharp\PlatziCSharp.csproj]
C:\Program Files\dotnet\sdk\3.1.201\NuGet.targets(124,5): error :   No such host is known. [C:\Users\steve\PlatziCSharp\PlatziCSharp.csproj]

Build FAILED.

C:\Program Files\dotnet\sdk\3.1.201\NuGet.targets(124,5): error : Failed to retrieve information about 'Microsoft.NETCore.App.Runtime.win-x64' from remote source 'http://packagesourc
e/FindPackagesById()?id='Microsoft.NETCore.App.Runtime.win-x64'&semVerLevel=2.0.0'. [C:\Users\steve\PlatziCSharp\PlatziCSharp.csproj]
C:\Program Files\dotnet\sdk\3.1.201\NuGet.targets(124,5): error :   No such host is known. [C:\Users\steve\PlatziCSharp\PlatziCSharp.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:08.30## Heading ##

It seems that it missing some dependencies, I'm really new on this and I couldn't find any answer online Anyone can help me how can I install what I'm missing? In the past I tried to do another .NET Core project but this same error appeared and I drop it, this is so frustrating.

jps
  • 20,041
  • 15
  • 75
  • 79

2 Answers2

0
  1. On Tools > Options... > NuGet Package Manager > package Sources, add a package source by source https://api.nuget.org/v3/index.json
  2. On tools > NuGet Package Manager > Package Manager Console enter dotnet restore command.
Roohi Ali
  • 628
  • 6
  • 7
0
  1. On Tools > Options... > NuGet Package Manager > package Sources, add a package source by source https://api.nuget.org/v3/index.json
  2. Restart Visual studio and reload your solution/project
H.Kashani
  • 1
  • 2