TheRealVira
TheRealVira

Reputation: 1614

Visual Studio 2019 | "Microsoft.VisualStudio.Azure.Containers.Tools.Targets" NuGet Package | "Not available in this source"

To reproduce this issue

  1. Create an ASP.NET Core 2.2 web application (Angular, single page)
  2. Right click on project and add docker support (linux container)
  3. done -> the package manager now shows an "warning" inside the dependencies stating that "Microsoft.VisualStudio.Azure.Containers.Tools.Targets" NuGet Package is not available in "this" source.

What I have tried so far

Expected Result

After adding docker support I have expected visual studio to download the latest versions of said azure container tools and automatically implement them so I could start docker simply by selecting "Docker" from the launch drop-down menu.

Actual Result

Visual studio didn't download the latest version of said NuGet package.

enter image description here

Upvotes: 2

Views: 4253

Answers (2)

HGohel
HGohel

Reputation: 53

Visual Studio tries to restore packages in the project from the sources that are specifiedin Tools > Nuget Package Manager > Package Manager Settings. In this case the package Microsoft.VisualStudio.Azure.Containers.Tools.Targets specified as a dependency wasn't available in any of the sources configured (possibly none). To resolve this, add nuget.org as a source with URL https://api.nuget.org/v3/index.json (see instructions in Microsoft's documentation for configuring package sources). Then VS will be able to find and restore it.

Upvotes: 3

Mohit Verma
Mohit Verma

Reputation: 5294

Try installing Microsoft.VisualStudio.Azure.Containers.Tools.Targets" version v1.4.4 which is the latest target file to enable the visual studio tools for containers.

You can download it from here

https://www.nuget.org/packages/Microsoft.VisualStudio.Azure.Containers.Tools.Targets/1.4.4

enter image description here

It worked for me with 1.4.4.

See if it helps.

Upvotes: 3

Related Questions