microsoft / DockerTools

Tools For Docker, including Visual Studio Provisioning and Publishing
Other
175 stars 26 forks source link

Debugger path 'C:\User\...\vs2017u5' for DockerFile is invalid. #226

Closed d1a9x8u9 closed 4 years ago

d1a9x8u9 commented 4 years ago

Steps to reproduce the issue

  1. Install VS 2019 Enterprise
  2. Create blank .NET Core(3.1) MVC project with Docker support (Linux)
  3. Run using Docker

Expected behavior

Application runs on Docker

Actual behavior

Application doesn't build and stops.

Additional information (e.g. issue happens only occasionally)

Windows 10 x64 VS 2019 Enterprise - updates up to date. I'm on a company computer. Happens every time i try to run docker in VS

Output of docker version

Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea
 Built:             Wed Nov 13 07:22:37 2019
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
  Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea
  Built:            Wed Nov 13 07:29:19 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker info

Client:
 Debug Mode: false

Server:
 Containers: 1
  Running: 0
  Paused: 0
  Stopped: 1
 Images: 22
 Server Version: 19.03.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.9.184-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 1.952GiB
 Name: docker-desktop
 ID: 4VLV:VWA7:77PK:PMEA:NDYF:EILY:GAAG:JSJZ:VRDK:C2IY:7QXL:JAC4
 Docker Root Dir: /var/lib/docker
 Debug Mode: true
  File Descriptors: 28
  Goroutines: 42
  System Time: 2020-01-14T19:23:26.9743616Z
  EventsListeners: 1
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

Docker File

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /src
COPY ["AppName/AppName.csproj", "AppName/"]
RUN dotnet restore "AppName/AppName.csproj"
COPY . .
WORKDIR "/src/AppName"
RUN dotnet build "AppName.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "AppName.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "AppName.dll"]

Build log

1>------ Build started: Project: AppsName , Configuration: Debug Any CPU ------
1>
1>Bundler: Begin processing bundleconfig.json
1>Bundler: Done processing bundleconfig.json
1>AppsName -> C:\...\bin\Debug\netcoreapp3.0\Apps.Core.dll
1>AppsName  -> C:\...\bin\Debug\netcoreapp3.0\Apps.Core.Views.dll
1>C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:\Users\MyPC\AppData\Local\Temp\GetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:\Users\MyPC\vsdbg\vs2017u5"
1>C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:\Users\MyPC\AppData\Local\Temp\GetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-musl-x64 -InstallPath "C:\Users\MyPC\vsdbg\vs2017u5\linux-musl-x64"
1>C:\Users\MyPC\.nuget\packages\microsoft.visualstudio.azure.containers.tools.targets\1.9.5\build\Container.targets(196,5): error CTC1023: The debugger path 'C:\Users\MyPC\vsdbg\vs2017u5' for Dockerfile 'C:\Source\...\AppName\Dockerfile' is invalid.
1>Done building project "AppsName .csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Right Click Build Docker Image log

1>------ Rebuild All started: Project: WebApplication6, Configuration: Debug Any CPU ------
1>WebApplication6 -> C:\Users\MyPC\source\repos\WebApplication6\WebApplication6\bin\Debug\netcoreapp3.1\WebApplication6.dll
1>WebApplication6 -> C:\Users\MyPC\source\repos\WebApplication6\WebApplication6\bin\Debug\netcoreapp3.1\WebApplication6.Views.dll
1>Docker version 19.03.5, build 633a0ea
1>docker build -f "c:\users\MyPC\source\repos\webapplication6\webapplication6\dockerfile" --force-rm -t webapplication6  --label "com.microsoft.created-by=visual-studio" --label "com.microsoft.visual-studio.project-name=WebApplication6" "c:\users\MyPC\source\repos\webapplication6"
1>Sending build context to Docker daemon  4.396MB
1>
1>Step 1/19 : FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
1>Step 2/19 : WORKDIR /app
1> ---> 5b704ff3cb6b
1> ---> Using cache
1> ---> 5af4ec75ea92
1>Step 3/19 : EXPOSE 80
1> ---> Using cache
1> ---> 6d5794b05c86
1>Step 4/19 : EXPOSE 443
1> ---> Using cache
1> ---> bf00f47c5f2a
1>Step 5/19 : FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
1> ---> 2fe8fe202baf
1>Step 6/19 : WORKDIR /src
1> ---> Running in ad593e22c6ac
1>Removing intermediate container ad593e22c6ac
1> ---> 27c1419626ab
1>Step 7/19 : COPY ["WebApplication6/WebApplication6.csproj", "WebApplication6/"]
1> ---> 5d4a6f153c3f
1>Step 8/19 : RUN dotnet restore "WebApplication6/WebApplication6.csproj"
1> ---> Running in b7b8554db3e7
1>/usr/share/dotnet/sdk/3.1.101/NuGet.targets(123,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/src/WebApplication6/WebApplication6.csproj]
1>/usr/share/dotnet/sdk/3.1.101/NuGet.targets(123,5): error :   The SSL connection could not be established, see inner exception. [/src/WebApplication6/WebApplication6.csproj]
1>/usr/share/dotnet/sdk/3.1.101/NuGet.targets(123,5): error :   The remote certificate is invalid according to the validation procedure. [/src/WebApplication6/WebApplication6.csproj]
1>Removing intermediate container b7b8554db3e7
1>The command '/bin/sh -c dotnet restore "WebApplication6/WebApplication6.csproj"' returned a non-zero code: 1
1>c:\users\MyPC\source\repos\webapplication6\webapplication6\dockerfile : error CTC1014: Docker command failed with exit code 1.
1>c:\users\MyPC\source\repos\webapplication6\webapplication6\dockerfile : error CTC1014: The command '/bin/sh -c dotnet restore "WebApplication6/WebApplication6.csproj"' returned a non-zero code: 1
1>Done building project "WebApplication6.csproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

I've tried deleting the vsdbg folder and running docker but i still get the same error. I tried to manually download the GetVsDbg.sh file from https://aka.ms/getvsdbgsh and put it in vsdbg\vs2017u5. This didnt work either.

Anyone have any solutions? Thanks!

d1a9x8u9 commented 4 years ago

bump

pratiksanglikar commented 4 years ago

Hi @d1a9x8u9 , Can you please confirm if C:\Users\MyPC\vsdbg\vs2017u5\linux-musl-x64\vsdbg path exists? If not, are you using any VPN that may prevent the download of vsdbg?

d1a9x8u9 commented 4 years ago

Hi sorry for the late reply @pratiksanglikar No I'm not on a VPN.

So i don't have the path you specified but i do have the path

C:\Users\MyPC\vsdbg\vs2017u5

which is what VS2019 is complaining about. The folder is empty for what its worth.

Any ideas?

pratiksanglikar commented 4 years ago

Hi @d1a9x8u9 , Can you please verify if the environment variable VS_CONTAINERS_SKIP_VSDBG_UPDATE_CHECK is set on your machine?

Also, can you please let me know the output of following -

  1. Download the VsDbg downloaded from https://aka.ms/getvsdbgps1
  2. Open the powershell terminal and navigate to the location where the downloaded file is located.
  3. Execute - .\GetVsDbg.ps1 -Version vs2017u5 -RuntimeID linux-musl-x64 -InstallPath "C:\Users\MyPC\vsdbg\vs2017u5\linux-musl-x64"
  4. Input R for Run Once when prompted
  5. Post the output of above command here.
d1a9x8u9 commented 4 years ago

Thank you @pratiksanglikar . I wasn't able to get past step 3 because of the following error:

.\GetVsDbg.ps1 : File C:\Users\MyPC\Downloads\GetVsDbg.ps1 cannot be loaded because running scripts is disabled on
this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\GetVsDbg.ps1 -Version vs2017u5 -RuntimeID linux-musl-x64 -InstallPa ...
'''
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Should I be able to run scripts in my companies execution policy in order to successfully use Docker on VS2019?

pratiksanglikar commented 4 years ago

Hi @d1a9x8u9 , At the moment we need to be able to run a script to use Docker. Can you try executing the script through the command prompt? C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -File "C:\Users\MyPC\Downloads\GetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-musl-x64 -InstallPath "C:\Users\MyPC\vsdbg\vs2017u5\linux-musl-x64"

Please replace the C:\Users\MyPC\Downloads\GetVsDbg.ps1 with the path to your download location of the GetVsDbg.ps1

If this still doesn't work, I am searching for a workaround.

d1a9x8u9 commented 4 years ago

@pratiksanglikar Btw i just checked and VS_CONTAINERS_SKIP_VSDBG_UPDATE_CHECK is not set in my env variables. What values do I set this to?

Also here is the script output:

Do you want to run software from this untrusted publisher?
File C:\Users\MyPC\vsdbg\vs2017u5\GetVsDbg.ps1 is published by CN=Microsoft Corporation, O=Microsoft Corporation,
L=Redmond, S=Washington, C=US and is not trusted on your system. Only run scripts from trusted publishers.
[V] Never run  [D] Do not run  [R] Run once  [A] Always run  [?] Help (default is "D"): r
Info: Using vsdbg version '16.3.10904.1'
Info: Using Runtime ID 'linux-musl-x64'
Info: Successfully installed vsdbg at 'C:\Users\MyPC\vsdbg\vs2017u5\linux-musl-x64'
d1a9x8u9 commented 4 years ago

@pratiksanglikar

I was successfully able to build the docker image in VS but running it using Docker now gives me a different error.

One or more errors occurred.
Failed to launch debug adapter. Additional information may be avaliable in the output window.
Building the project is successful but errors out on launch.

But it looks like the container is running the image fine in the Containers Window but I'm not able to access it by clicking the port number in ports.

Debug Output

The program '' has exited with code -1 (0xffffffff).

I've reset Docker credentials, restarted docker and VS, pulled latest core image, and clean and rebuilt solution and image but the problem persists.

I've also noticed that since the docker image was built successfully in VS, I was able to use the command prompt to launch the image in a container outside of VS and can confirm that the app is working.

Any ideas?

pratiksanglikar commented 4 years ago

@d1a9x8u9 , I'm glad you were able to download the the linux-musl-x64 package. For debugging you would also need the linux-x64 runtime.

You can install that with the following command- C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -File "C:\Users\MyPC\GetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:\Users\MyPC\vsdbg\vs2017u5"

Again, please replace the C:\Users\MyPC\Downloads\GetVsDbg.ps1 with the path to your download location of the GetVsDbg.ps1.

You can set the flag VS_CONTAINERS_SKIP_VSDBG_UPDATE_CHECK=TRUE to skip downloading latest vsdbg.

In your case, since script execution is disabled, you can set this env variable to skip downloading the vsdbg.

If the issue persists after installing the linux-x64 runtime, can you post the full log?

celikada commented 4 years ago

I am using comodo internet security. Same issue happens. "CTC1023 ...... \vsdbg\vs2017u5' for Dockerfile.... Container.targets Dockerfile is invalid" Disabled all virus protection, firewall, HIPS, than 'Docker' again. Works for me. I hope it works for you.

pratiksanglikar commented 4 years ago

Closing this ticket because we don’t have enough information to investigate further. To keep the problem open, please provide the requested details.

marcelbeeker commented 4 years ago

Hi, I had this problem too. Running VS2019 Enterprise and Eset Internet Security. Disabled the firewall and protection -> restart Docker Desktop -> debug the application solved my problem. After that, I enabled Eset again -> I can still debug my application.

nbon12 commented 4 years ago

I have the same problem as the original poster, with the same replication steps.

nbon12 commented 4 years ago

Hi @d1a9x8u9 , Can you please verify if the environment variable VS_CONTAINERS_SKIP_VSDBG_UPDATE_CHECK is set on your machine?

Also, can you please let me know the output of following -

  1. Download the VsDbg downloaded from https://aka.ms/getvsdbgps1
  2. Open the powershell terminal and navigate to the location where the downloaded file is located.
  3. Execute - .\GetVsDbg.ps1 -Version vs2017u5 -RuntimeID linux-musl-x64 -InstallPath "C:\Users\MyPC\vsdbg\vs2017u5\linux-musl-x64"
  4. Input R for Run Once when prompted
  5. Post the output of above command here.

This is the output:

.\GetVsDbg.ps1 : File C:\Users\nbonilla\Downloads\GetVsDbg.ps1 cannot be loaded because running scripts is disabled on
this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\GetVsDbg.ps1 -Version vs2017u5 -RuntimeID linux-musl-x64 -InstallPa ...
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

I then enabled running scripts, then I tried this command:

C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -File "C:\Users\MyPC\Downloads\GetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-musl-x64 -InstallPath "C:\Users\MyPC\vsdbg\vs2017u5\linux-musl-x64" 

the output is:

CylancePROTECT Script Control has blocked access to this PowerShell script.
sguidos commented 3 years ago

I am also having this problem. 'GetVsDbg.ps1' exists in the 'C:\Users\guidoss\vsdbg\' folder, and when I run the suggested PowerShell command .\GetVsDbg.ps1 -Version vs2017u5 -RuntimeID linux-musl-x64 -InstallPath "C:\Users\guidoss\vsdbg\vs2017u5\linux-musl-x64" the 'vs2017u5' and 'linux-musl-x64' are populated with files of version '16.8.11013.1'.

I have set VS_CONTAINERS_SKIP_VSDBG_UPDATE_CHECK=1, but when I launch the Docker container from with VS2019, the Output window still reports "Info: C:\Users\guidoss\vsdbg\vs2017u5 exists, deleting." and in Explorer I can see that the entire folder 'C:\Users\guidoss\vsdbg\vs2017u5' is deleted and re-created, but only partially re-populated with the previous files (I assume it stops once it hits the 'used by another process' error).

So, first of all, it appears that the VS_CONTAINERS_SKIP_VSDBG_UPDATE_CHECK=1 environment variable is not being respected. I have tried re-starting VS 2019, to no avail.

Even weirder: 1 - The 'C:\Users\guidoss\vsdbg' folder already had the file 'GetVsDbg.ps1' but it was setting an older version in the $VersionNumber variable. I copied the updated script to this folder, just in case, but it did not make a difference.

2 - When I manually run the newest downloaded 'GetVsDbg.ps1' file in PowerShell, the vsdebug folder appears to have been updated to version '16.8.11013.1'. If I re-run 'GetVsDbg.ps1' again, it tells me 'Latest version of VsDbg is present. Skipping downloads'

3 - Then, when I try to launch my container from VS 2019, the Output log shows: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:\Users\guidoss\AppData\Local\Temp\GetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:\Users\guidoss\vsdbg\vs2017u5" Info: Using vsdbg version '16.8.11013.1' 1>Info: Using Runtime ID 'linux-x64' 1>Info: C:\Users\guidoss\vsdbg\vs2017u5 exists, deleting. 1>C:\Users\guidoss\AppData\Local\Temp\GetVsDbg.ps1 : Exception calling "ExtractToDirectory" with "2" argument(s): "The 1>process cannot access the file 'C:\Users\guidoss\vsdbg\vs2017u5\System.Security.Cryptography.Primitives.ni.dll' 1>because it is being used by another process." 1> + FullyQualifiedErrorId : IOException,GetVsDbg.ps1 1> + CategoryInfo : NotSpecified: (:) [GetVsDbg.ps1], MethodInvocationException 1> 1>C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:\Users\guidoss\AppData\Local\Temp\GetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-musl-x64 -InstallPath "C:\Users\guidoss\vsdbg\vs2017u5\linux-musl-x64" 1>Info: Using vsdbg version '16.8.11013.1' 1>Info: Using Runtime ID 'linux-musl-x64' 1>C:\Users\guidoss\AppData\Local\Temp\GetVsDbg.ps1 : Exception calling "ExtractToDirectory" with "2" argument(s): "The 1> + CategoryInfo : NotSpecified: (:) [GetVsDbg.ps1], MethodInvocationException 1>process cannot access the file 'C:\Users\guidoss\vsdbg\vs2017u5\linux-musl-x64\Microsoft.CodeAnalysis.CSharp.Expression 1> 1>Evaluator.ExpressionCompiler.ni.dll' because it is being used by another process." 1> + FullyQualifiedErrorId : IOException,GetVsDbg.ps1 1>C:\Users\guidoss\.nuget\packages\microsoft.visualstudio.azure.containers.tools.targets\1.9.10\build\Container.targets(198,5): error CTC1023: The debugger path 'C:\Users\guidoss\vsdbg\vs2017u5' for Dockerfile 'C:\temp-TFS\K8sService-HelloWorld\HelloWorld\Dockerfile' is invalid. 1>Done building project "HelloWorld.csproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Note that VS 2019 is running the GetVsDbg.ps1 script from the 'C:\Users\guidoss\AppData\Local\Temp\' folder, and attempting to delete and re-install vsdebug.

4 - In PowerShell, when I go to 'C:\Users\guidoss\AppData\Local\Temp\' and run GetVsDbg.ps1, it will update vsdebug to the latest version 16.8.11013.1 (because many of the files are missing). When Visual Studio runs that same script from the Temp folder as part of launching Docker, it deletes and tries to update the vsdebug folder. It's almost like when VS 2019 runs the script file, it is not correctly detecting the version of vsdebug, and thus trying to delete and re-install it. But when I manually go to the Temp folder and run the script thru PowerShell, it can correctly detect that the latest version is installed and 'skip'. The same script file in the Temp folder gives 2 different results depending in whether VS 2019 runs it or whether I run it manually through PowerShell.

Also, in case this is relevant, I am working remotely on a corporate zScaler VPN.

Help!

sguidos commented 3 years ago

After I submitted the above post, I edited the C:\Users\guidoss\AppData\Local\Temp\GetVsDbg.ps1' and edited the IsLatest() function to always return TRUE. But when I tried to launch my Docker container, I go the same error, and when I went back to re-edit the script, my changes had been replaced. So Visual Studio is copying a new copy of the 'GetVsDbg.ps1' file to the Temp folder when launching the container. My next thought was to find the "source" of this file on my disk and make my edits there. But I cannot find that file anywhere else on my disk. I even searched my disk for some text within the script. but could not find the source of this script file. So I can only assume the VS 2019 is downloading this file from somewhere (again ignoring the VS_CONTAINERS_SKIP_VSDBG_UPDATE_CHECK=1 flag, LOL).

Every time I try to launch the container, VS 2019 'updates' the Temp\GetVsDbg.ps1 script file to the exact same contents, with the exact same vsdebug version number that I already have; then it runs that script and reports that it needs to delete and re-install vsdebug :-(

pratiksanglikar commented 3 years ago

@sguidos Apologies for the confusion. Please set VS_CONTAINERS_SKIP_VSDBG_UPDATE_CHECK=TRUE. I have updated the original comment reflect that as well.

sguidos commented 3 years ago

Thanks, that helped, because now I have a new error message :-( "One or more errors occurred. Failed to launch debug adapter. Additional information may be available in the output window. The operation was canceled./" The DEbug Output windows only reads "The program '' has exited with code -1 (0xffffffff)." which is another error the user above encountered.

This error is very generic, and searching for it has not yeilded any helpful suggestions on how to fix it. Most results have to do with running browser problems while trying to debug a web app, but here I have a simple one-line Console App.

I did see in https://docs.microsoft.com/en-us/visualstudio/containers/troubleshooting-docker-errors?view=vs-2019#unable-to-start-debugging that when you are having trouble debugging a Docker container, you should delete the folders:

del %userprofile%\vsdbg
del %userprofile%\onecoremsvsmon

Since I was having problems with the vsdbg folder, I thought this might be a clue. And when I go to my %userprofile% folder, the 'onecoremsvsmon' folder is completely missing. How do I get this folder back? Is there a PowerShell script I can use similar to the 'GetVsDbg.ps1' script above? What else can I try to get back to debugging Docker?

cbjpdev commented 3 years ago

@pratiksanglikar

I was successfully able to build the docker image in VS but running it using Docker now gives me a different error.

One or more errors occurred.
Failed to launch debug adapter. Additional information may be avaliable in the output window.
Building the project is successful but errors out on launch.

But it looks like the container is running the image fine in the Containers Window but I'm not able to access it by clicking the port number in ports.

Debug Output

The program '' has exited with code -1 (0xffffffff).

I've reset Docker credentials, restarted docker and VS, pulled latest core image, and clean and rebuilt solution and image but the problem persists.

I've also noticed that since the docker image was built successfully in VS, I was able to use the command prompt to launch the image in a container outside of VS and can confirm that the app is working.

Any ideas?

I am getting the same error in vs 2019 and .net core 5. I manually downloaded by below urls and unzipped to folders. https://vsdebugger.azureedge.net/vsdbg-16-8-11013-1/vsdbg-linux-musl-x64.zip https://vsdebugger.azureedge.net/vsdbg-16-8-11013-1/vsdbg-linux-x64.zip

C:\Users\xxx\vsdbg\vs2017u5\linux-musl-x64 C:\Users\xxx\vsdbg\vs2017u5\linux-x64

container is building and i can go into container also. But I am getting this "The program '' has exited with code -1 (0xffffffff)." followed by failed to launch debugger adapter popup.

But this is happening only on my corporate laptop. Personal pc works with latest docker and vs. any more thing to check

Edit: It just need to extract to C:\Users\xxx\vsdbg\vs2017u5

no need sub folder name. so manually download below package, sorted my problem https://vsdebugger.azureedge.net/vsdbg-16-8-11013-1/vsdbg-linux-x64.zip

juxhinxhihani commented 1 year ago

Hi @d1a9x8u9 , Can you please confirm if C:\Users\MyPC\vsdbg\vs2017u5\linux-musl-x64\vsdbg path exists? If not, are you using any VPN that may prevent the download of vsdbg?

Hi @pratiksanglikar, I have the same error. The path exist but the folder is empty

brunomartinspro commented 1 year ago

For my case it was my antivirus (comodo) that was blocking visual studio from correctly extracting the files to vsdbg\vs2017u5. After i excluded the visual studio process in the antivirus, visual studio was able to extract the files as soon it detected Docker Compose and no reinstall was needed.