Reputation: 91
I'm working on a .net core project in Visual Studio 2017 Enterprise. I've added Docker support to the project, and I press F5, I get this error:
An error occurred while sending the request
This error occurs in the Microsoft.VisualStudio.Docker.Compose.targets (327,5).
Looking for any help I can get!
UPDATE
I found out that VS is trying to send a request to aka.ms, and that is where the problem is comming from. I'm trying to get it to work in a closed network, and because of that request I can't start it in VS. I am able to run it in the command line using
docker-compose
Upvotes: 3
Views: 3902
Reputation: 511
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:
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'
Close solution in Visual Studio.
Download debugger which you need from the aforementioned url template
https://vsdebugger.azureedge.net/vsdbg-(Version)/vsdbg-(Runtime ID).zip
Change .
into -
for Version.
Unzip and copy to the target directory
(mentioned above)
Inside the target directory
create a file called success_rid.txt
with content of (Runtime ID)
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.
Upvotes: 1
Reputation: 91
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!
Upvotes: 4