-
Notifications
You must be signed in to change notification settings - Fork 522
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
debugging .NET containers fails out of the box #759
Comments
@jldeen Can you describe the type of project/workspace to which you're adding Docker files and debugging? What version of the I'm not seeing the missing |
@philliphoff I used a public project in the Azure Draft example-dotnet repo - it's a simple demo project. https://github.com/Azure/draft/tree/master/examples/example-dotnet. Version of Here is the Dockerfile that is produced:
As you can see, there is no |
How strange. When I generate the Docker files for that project, either as an individual workspace or as part of the larger repo workspace, I get a Dockerfile that includes the I noticed that the repo's current version of the project targets |
I'm not sure what I'm doing wrong then, I have tried this on two different computers with that same project. I tried with a complete fresh dotnet application (also on 2 computers)
So still no
.NET Core Launch (web) works fine, launches a browser at |
Huh, that's so odd. When you're adding the Dockerfile, are you even prompted to enter a port (after selecting the project type (ASP.NET Core) and OS (Linux))? Usually port |
I am not prompted to enter a port for .NET Core Console, only for Node.js apps. I recorded a short 5 min video of what I'm seeing. I'm not using my normal video editing system at the moment so the video says "Demo mode" but you will get the gist. There are two demos - the first one is the Edit I just realized, you said project type as |
Ok, using Also, adding clarity to what the difference between ASP.NET Core and .NET Core Console is/does for the Docker extension might be helpful. |
@jldeen Ah, ok, so I see the same issues you are when using the public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseUrls("http://*:5000")
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run();
} After that, debugging works as expected. So I've compiled a few notes:
I also noticed that we don't yet support the ability to set/override the URL browsed to for an arbitrary container. (Currently the debugger detects the container exposing port 80 and, if it does, then browses to that port.) I'll add an issue to add that support. In any case, I'm glad you've got things working and I really appreciate the time you took to work through these issues. You've provided some great feedback for how we can improve the product/documentation. Thanks! |
Added #764 for overriding the browser URL. |
Added #766 for improving the documentation related to Dockerfile generation. |
Closing this in favor of the individual issues this spawned, as the primary issue has been resolved. |
Tested out debugging dotnet core Linux containers on 2 different macOS systems, one with a completely clean VS Code installation.
VS Code Version: 1.30.2 (1.30.2)
Docker Version: 2.0.1.0 (30090)
.NET Core SDK: 2.2.103
macOS: 10.14.3 Beta (18D39a)
Steps to reproduce
Encountered error below:
Error:
When I navigate to localhost:5000 nothing is serving. I noticed the VS Code created Dockerfile is not exposing any port. I added two lines and still could not get the debugging to work.
As such I have not been able to test setting breakpoints and perform live debugging of my .NET Core container.
I did do further debugging and noticed there does not appear to be a port published for the container run with the debugger:
The text was updated successfully, but these errors were encountered: