Visual studio container debugging with a remote docker host - visual-studio

Can you start a container from visual studio but somehow specify to run the container on a remote container host?
My specific scenario - I have an asp.net core app, I added docker support and want to debug using docker when I press F5, however, I would like to use a remote (other computer on the network) installation of the docker host.
This question may not even make any sense as I have probably misunderstood what I'm doing.

Related

Using host visual studio license to run build tools in windows container?

I have a windows server 2019 host that has licensed installation of Visual Studio 2019. I also have docker on the host machine and am building a container image. I want to access host VS build tools from within the container. Wondering if I can use the host's license key to use build tools within my container? I don't want to install build tools directly in my container, since I am having problems doing that and also I am not sure if I will break any licensing terms since I will basically create this docker image and make it available for others to use. If my docker run can verify that the host is licensed for Visual Studio, I can then mount build tools from host into container. But am not sure if this case is covered by the supplemental license. Please suggest
If the above is possible, do I mount the host's key from windows registry? Suggestions on how to have my docker read the host's registry key?

Container only works while running from Visual Studio

I have got the sample WeatherForecast API in VS 2019 with Docker support. I build the solution and run it with Docker profile. I can see the image gets created in Docker Desktop, container is running and I can access the https://localhost:49181/weatherforecast URL.
But as soon as I stop running the solution from VS, that URL becomes inaccessible.
Any ideas what could be happening? Shouldn't I be able to access the API/URL once it's deployed in Docker and VS is not running?
Container is running even when VS has stopped

Unable to access api running in docker from host machine but works while debugging with VS2019

I am trying to run a docker container on my windows 10 machine using docker for desktop.
I am using sdk:3.1-alpine AS my base image.
My docker file is the default file generated by VS 2019 and my API is the default controller generated by VS2019 with dotnetcore 3.1.
What I see that I am able to access the API running in my docker container from host machine only when I am debugging using Visual studio, however as soon as I stop debugging I am not able to access the API anymore even though the docker container is still running.
What do I need to do to access my API without debugging it using VS2019.
I was hitting the http port whereas by default https redirection was enabled. However the redirection doesnt work from container.

Deploying docker container to production server from Visual Studio 2017 RTM

I'm completely lost on this.
I have installed Docker on my Windows 10 machine. It is running. I shared out my C drive in Settings. I then created an ASP.NET Core 1.1 project with Docker support in Visual Studio 2017 RTM. Once the project was created, I hit F5 to run it. It built the container, deployed it to my local Docker installation, and launched my web browser. There is my web site running! Yay!
I'd now like to take that container, and deploy it to Docker running on a Linux machine, but there is no Publish option in Visual Studio for the docker-compose project. I can Publish the web project, but only to Azure or IIS.
I have looked all over for an answer to this, but all I can find is how to deploy locally, and I've already figured that out.
There is currently no publish option from within the tooling that will push an image to a registry, but you should be able to do this fairly easily. I would recommend to build the "release" configuration of the docker-compose project which should build an image locally. You can then use the docker command line to push that image to Docker Hub or Azure Container Registry, in which you can then pull it down to the Linux docker machine.
If your code is stored in a Git repo and it has a Dockerfile in the root, you can use Cycle to build the image on the server and deploy it there all in one easy to use interface.

remote debugging in visual studio cannot connect

Hello i have a problem with remote debugging in Visual Studio (v12)
I Created windows azure account i published application to the cloud.
Then i connected to this account through remote desktop. Address of remote computer is f.e Iron.app.net
Then i downloaded there and run remote debugger. I started msvsmon.exe and it created server named:
RD0015555E2:555
And now i would like to remote debugging in my host.
i know i must attach to process. And i do it.
From Visual Studio: Debug->attach to process->Qualifier:RD0015555E2 and it cannot resolve host name.
i also tried Iron.app.net but then it shows error that it seems that msvsmon is not installed.
I dont know what should i type into Qualifier (as remote machine)?
Remote debugging is tricky to configure Windows Azure Cloud Services. Other options that you have are:
Intellitrace (in case you've got Visual Studio Ultimate)
Intensive (verbose) pro-active code instrumentation (logging) from the beginning.
Profiling Cloud Service
Chose either, and watch your logs/traces.
Or deep dive into Remote Debugging Cloud Services. I would, however use Remote Debugging as a final option, when everything else does not work and does not help me. Typically most of the issues that would pop in the cloud will also pop in when debugging locally. And if role is just recycling, you will not be able to attach debugger at all.

Resources