-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remote Debugging with Docker? #220
Remote Debugging with Docker? #220
Comments
Thinking this question probably is more relevant to the .NET Core repo, so I posted it over there as well. |
Yes, in in the build demo the container was running .NET Core. Are you asking about VS Code or VS? |
@greg-miskelly Thanks for answering my question. Technically what is it that VS Code needs to support remote debugging for .NET Core? |
'Remote Debugging' is kind of a big area as there are lots of different scenarios that might be interesting -- ex: remote to Docker containers, remote to a stand along Linux server over SSH, remote to a Windows PC, remote to Azure, etc. Lets talk about Docker as that is probably the easiest one to accomplish. For that we need:
My guess is that this isn't going too far away. But right now the VS Docker Tools folks are concentraiting on getting the VS end-to-end ready to be shipped. |
@gregg-miskelly, Thanks for the clear explanation - helps to understand what has to be done. Glad you addressed the Docker scenario, which is what I'm most interested in.
I've seen some traction on creating updated Docker images. See this issue on the dotnet/cli repo. And it "feels" like RC2 may be getting close. 😄
Maybe these are low hanging fruit? 😉 |
In terms of the debugger work - yes, I think this work should be pretty easy. |
I was wondering what the latest was with this? Is all the functionality available in theory for me to try hook it up? I've seen commit https://github.com/OmniSharp/omnisharp-vscode/pull/415/files referencing Docker related changes. I've tried stumbling around using ^^ and https://github.com/Microsoft/MIEngine/wiki/Offroad-Debugging-of-.NET-Core-on-Linux---OSX-from-Visual-Studio as ref but not go it working yet. I'm trying to get VS Code to attach to the clrdbg in docker without installing Dotnet core clr locally on OSX. When I try and launch the debugger I get the My launch config:
|
@janaka The Visual Studio Docker Tools team is working on scaffolding to use the You will however still need to install the .NET CLI locally - we still depend on it for running the local parts of the debugger, doing builds, etc. |
Thanks. @gregg-miskelly |
Well release .NET Core RTM versions today |
@SteveLasker @gregg-miskelly Thanks. Sounds like the Yo generator will answer more of my questions I'll dig in later. As we (Hudl.com) adopt .Net Core it could be any of those. I've been using a Web app and an API to experiment with things .Net Core and Docker related. A lot of our devs are on Mac. Today they have to develop in Parallel, the developer experience sucks. With debugging in Docker I'm thinking about the developer experience and how that can connect to deploying to test and prod environments, the development workflow. |
Pls let me know if I can remote debug a container on Ubuntu machine from my windows machine using visual studio 2015 update 3 |
@schusovskoy that output looks like it is the target process which is immediately exiting. Do you see a module load for your dll? |
@gregg-miskelly thank you for reply. I think I've found the problem. I tried to run and debug bin/debug/netcoreapp1.0/test.dll and not the published version in bin/debug/netcoreapp1.0/publish/test.dll. (https://github.com/schusovskoy/apsnet_remote_debug) If someone will face the same problem, hear is the link to the working demo. |
@schusovskoy thanks for the link and those scripts! @gregg-miskelly I was hoping to do this in a simpler way. My launch.json invokes a script which when run directly from a terminal drops me into a shell in the target container 🎉. But when I invoke the debugger through VS Code I get the following message (line wraps added to protect the innocent). Feels like I'm close, any suggestions? Thanks!
|
@schusovskoy you need to update your csharp-debug.sh script to expect that it will be passed an argument containing the quoted command to be run. |
Sorry, that should have been @joshgav. |
With node.js, I can expose port 5858 and then VS Code can attach to that port. |
@styfle .NET Core debugging doesn't work like that - what you want to do is:
There used to be a |
@gregg-miskelly can you explain more about that 2 steps ? Please tell how should be the pipeTransport, this is the yo docker defaults :
OS Version : macOS Sierra |
CC @glennc @Andrew-MSFT I think I would probably recommend pulling vsdbg as some sort of occasional step instead of doing it every time you build your container. Ex: Maybe only do it if vsdbg isn't pulled down locally already, or, if you want to get fancy, only do it once a day or something like that. The command you want to pull vsdbg is similar, but you need to also include The Alternatively, another user reported success with:
For the soon-to-be-released 1.9 version of the extension we added a new |
I develop in mac os, but I had to debug via I hope the easier way to resolve this issue. Best wish:) |
I found a solution. https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes |
I'm on OSX using VSCode and have followed the above link and installed vsdbg. Below is my launch json. I get a remote process to attach to but then nothing. Breakpoints are greyed out and I see in the debug console every 2 secs or so Can anyone suggest what I might be doing wrong? I feel I'm close to getting it to work
|
@jchannon Did your machine be authorized by the server? |
I'm not sure what that means 😄 |
You should publish your |
I'm not on SSH, I'm on Docker |
The output I get suggests its kind of working in that it can see my app's PDBs but then seems to throw the socket exception for some reason and the breakpoints in vscode arent working:
|
One thing to consider is my app in the container is a self contained app |
One for @gregg-miskelly or @SteveLasker maybe? |
First, I apologize for the rapid changes that have been happening here. Docker scenarios are rapidly changing and we're working to stay ahead of the curve, which means we must change and prioritize. |
Will check it out but I feel it's really close. The dlls seemed loaded by
vsdbg etc it's just VSCode that can't attach breakpoints and the socket
exception or is that a massively naive thing to say? :)
…On Thu, 1 Jun 2017 at 19:18, Steve Lasker ***@***.***> wrote:
First, I apologize for the rapid changes that have been happening here.
Docker scenarios are rapidly changing and we're working to stay ahead of
the curve, which means we must change and prioritize.
While we started with yo docker and VS Code, we prioritized Visual Studio
2017 and have shipped what I'd hope would be considered a great container
debugging experience.
We then shipped a preview of VS for Mac
<https://www.visualstudio.com/vs/visual-studio-mac/> container debugging.
This slipped in as a priority between VS for Windows and VS Code.
We are discussing when we can re-prioritize VS Code Container debugging to
deliver the robust experiences we know developers want.
My suggestion would be to give the VS for Mac, Alpha Channel:
https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/
Steve
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#220 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGapmx2ZvKus5f6ELp0KL3RfZlXZKk3ks5r_wCAgaJpZM4IKeoA>
.
|
@jchannon I am assuming you are publishing a release (optimized) version of your app? Does the breakpoint hit if you publish debug instead? Release debugging is hard :) The socket exception doesn't sound like a tooling issue. |
All works fine if in debug mode! 😄 |
@jchannon What did you do? Debug in docker container? |
Node.js 4.x supports remote debugging, and VS Code is able to place nicely with it. I'm wondering if anyone know if .NET Core supports remote debugging? I seem to recall a part of @shanselman's Build demo where he used the VS Tools for Docker to remote debug into a Docker container. But I can't remember if the container was running .NET Core. I'd be grateful for any information on this.
The text was updated successfully, but these errors were encountered: