![]() ![]() ![]()
#VISUAL STUDIO REMOTE DEBUGGING QNAP DOCKER FOR MAC#Docker: I recommend Docker for Mac or Windows, which are in public beta. #VISUAL STUDIO REMOTE DEBUGGING QNAP DOCKER HOW TO#Here I’m going to show you how to do it yourself. The especially cool part was when I live-debugged a Node.js app running inside a container from my IDE, despite having no Node.js runtime installed on my laptop. My best guess is that VS and Docker still need to work on their relationship.During the DockerCon 2016 keynote, I demonstrated a development workflow with Docker for Mac, going from a fresh laptop to a running app in no time. *Note: I am using Linux Containers because Windows Containers didn't even allow me to debug properly. I am still learning and there is a lot to understand there. Another thing I noticed: The attach doesn’t work with Windows Containers and I would have to use F5 to debug it. Maybe this is a small bug in the dockerfile generated by Visual Studio, which means I should learn how to create my own dockerfile manually until it’s fixed. But when I detach and reattach it goes as fast as I am used to. For someone who isn’t used to work with Docker I noticed that it takes a couple of seconds to attach when compared with a normal run. At this time it works without any problem. Once I’ve done that, I repeated my debugging steps: run without debug and attach. So, I copied that part and pasted into my own dockerfile, just being careful to replace unzip with curl. #VISUAL STUDIO REMOTE DEBUGGING QNAP DOCKER INSTALL#The most important thing for me in that file was what seemed to install “curl”. But after some investigation I found a dockerfile that could help me as it seemed to match mine. It turns out that I didn’t have that “unzip” installed in my container. The most important part of the whole text from the Output Window is written in red, at the bottom: ERROR: Command 'unzip' not found. And that was the moment I regret that I don’t really know Linux: Since the exception was also pointing to the Output Window, it was a good idea to check there too. Unfortunately, I got an exception after a couple of seconds saying that the launch debug adapter failed to launch. #VISUAL STUDIO REMOTE DEBUGGING QNAP DOCKER CODE#The code would be attached, and I would be able to debug. Since I am using Linux Containers*, I will choose the only option available. There is one extra step here which is the type of the code. But since I am using Docker, I must select the connection target, which is the name of the container, and the process, which is “dotnet”. That opens a dialog where I can select the process. Whenever I want to debug, I simply attach the Visual Studio to the process of the project (Ctrl+Alt+P). Not to mention that I would not hit random breakpoints I’ve added and forgot to disable. I prefer to do that because it gives me the feeling that I am running closer to a real application. So, I did my usual: Start the project without debugging (Ctrl+F5). Anyway, here is the result so far:įrom that point I just wanted to see if what would happen when I run the project. Perhaps the best option is to “dockerize” a project after it’s been created. The result was a couple of duplicated files that I ended up deleting later. I decided to do both since I was just playing around. …or create a “dockerized” project from scratch. In case you don’t know, you can “dockerize” existing projects… But I ended up running into problems which resulted in a small thread on Twitter that I am expanding here.Įverything started when I decided to use Visual Studio 2019 to take care of Docker for me. You know, just to make sure that I understood everything well. I’ve been reading about Docker for a couple of weeks already and, few days ago, I decided to create a small proof of concept. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |