Visual Studio can't create a docker image Visual Studio can't create a docker image docker docker

Visual Studio can't create a docker image


I found the fix to my problem.

When you try to build a project with docker support, Visual Studio tries to download a file named GetVsDbg.ps1 from aka.ms.So to fix the problem, you need to download the file manually, and place it in the %temp% folder.

After that you need to comment out the last part, the one that tries to download some zip from vsdebugger.azureedge.net.Then, you need to find your vsdbg version(when you try to build your .net core project, you can find it in the output->build section) and browse to:

https://vsdebugger.azureedge.net/vsdbg-(Version)/vsdbg-linux-x64.zip

The version looks something like this: 15-1-11011-1. After you download that zip, extract it to C:\Users(Username)\vsdbg.

Be sure to remove existing containers of that project(if there are any), and build the project again.

This fixed my problem, hope that it will help others!


Over 3 years later the issue is still valid if, for example, your security sofware blocks execution of said Power Shell script (GetVsDbg.ps1) when orchestration is prepared by VS 2019.

There is, though, an easier workaround to achieve desirable solution, than very good and working accepted answer, namely by deceiving VS 2019 into thinking that up-to-date and accurate version of the remote debugger is already placed under the following directory, called later target directory

%userprofile%\vsdbg\vs2017u5

Caveat: This workaround assumes all debugging sessions will be performed with the same OS.

Recipe:

  1. Gather required information - Version of the tools and target Runtime ID from a spill out of the Containers Tools output during orchestration ie.

Info: Using vsdbg version '16.9.20111.1'
Info: Using Runtime ID 'linux-x64'

  1. Close solution in Visual Studio.

  2. Download debugger which you need from the aforementioned url template

    https://vsdebugger.azureedge.net/vsdbg-(Version)/vsdbg-(Runtime ID).zip

    Change . into - for Version.

  3. Unzip and copy to the target directory (mentioned above)

  4. Inside the target directory create a file called success_rid.txt with content of (Runtime ID)

  5. Inside the target directory create a file called success_version.txt with content of (Version)

Done. Solution can be reopened now, upon next orchestration something like this should be produced:

Info: Latest version of VsDbg is present. Skipping downloads

which means GetVsDbg.ps1 assumes now it has what is needed for debugging. Given 'docker-compose` is correct all containers should be prepared as expected.