Visual Studio Container Tools Extension (Preview)

A couple of days ago, I came across the Visual Studio Container Tools Extension (Preview) Announcement.

Using docker, this VS2019 extension promises to be very useful for container image development and debugging.

Here is my first run through, using the aspnetapp sample docker image.

Preparation

The extension can be installed directly via Visual Studio 2019, or downloaded from the marketplace, as shown below.

visual studio container tools extension download

Once installed, you obviously need to have a running container to watch it in action. For my quick test, I’ve chosen the aspnetapp sample image from mcr.microsoft.com/dotnet/framework/samples:aspnetapp, for which I started up a related container with the following command.

docker run -d -p 8000:80 --name aspnet_sample mcr.microsoft.com/dotnet/framework/samples:aspnetapp

Run through

The extension provides an additional container view. Just use search, or View > Other Windows > Containers, to open it.

Opening the containers view

On the left pane of the Containers view, you get a list of all your available containers. Here you can also start, stop and remove your containers.

Initial containers view

The main area provides 4 tabs at the moment, which are used to explore the container in more detail.

If you click on the highlighted Host Port entry on the Ports tab, a related client will be opened, if available.

Ports tab

In my case, that is just a web browser to view the default ASP.NET project template landing page.

opened client

Logs allows you to view the output of the docker logs command directly in VS as well. For example:

docker logs aspnet_sample
docker logs example output
via docker command line
docker logs output in visual studio 2019
in VS

Last, but certainly not least, there is the Files tab. Personally I think, that this is by far the coolest feature of the extension at the moment. Not only does it allow to easily explore the folder structure of the container, but also directly open the files in visual studio.

Directly browsing the containers folder structure in visual studio

Conclusion

I certainly will monitor the progress of the visual studio container tools extension and am looking forward to (hopefully) getting more features (e.g. a docker command line tab) integrated.

1 Comment

  1. […] the Visual Studio Container Tools Extensions , I can check the container logs without leaving Visual […]

Comments are closed.

Scroll to top