Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a Docker Container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Great extension (started awesome, not anymore). Does not work out of the box with multi project solutions. Main project gets build and added to docker container, but the dependencies (other projects in the solution) do not.
0.12 <= version had a nicer integration with visual studio, "publish to" worked great with a on premise docker server. Later verions made it more of a problem since you had to add the remote docker host to docker-machine (every developer has to do this, annoying!).
Hope some day they bring back the "publish" feature, and keep the current docker-machine for local debugging of containers.
Hi Sebas, We are just beginning to explore multi-container support. The challenge is launching a debugger across multiple containers. Possible, but we're still exploring. What you can do is build each project, and in the project/container you wish to debug, add the other image references. That assumes you're looking to run multiple containers for each project. If you're trying to compile multiple projects into one container, that would be good to know, and what's not working. Steve Lasker Blogs.msdn.com/SteveLasker
Can you go to Control Panel\Programs\Programs and Features and check the version of 'Microsoft .NET Core 1.0.1 - VS 2015 Tooling Preview 2'? If it is not 1.0.20908.53 or above, please update the .NET Core tools to the latest.
I took a clean machine and installed (in this order) Full IIS, Hyper-V, VS2015 Enterprise, .NET Core 1.0.1 Tooling Preview 2, Docker for Windows, Visual Studio Docker Tools, and a few other random programs.
I then opened VS2015 and created a default .NET core website. Hit F5 and all works. Then I go to Add->Docker Support. Now when trying to run (F5) using Docker I see this error message:
The "PrepareForCompile" task... DotNet.Docker.CommandlineClientException: Error response from daemon: Container ... is not running
I have searched online and the only thing I can find that might explain it is that I don't think Shared Drives are working. I did set it up in Docker->Shared Drives, but when I run:
docker run -it -v /C/Users:/wormhole busybox
the directory is empty
Any Ideas? Is Shared Drives just a red herring?
I have VS Professional 2015, Update 3, on the Windows 7. I've installed Visual Studio Tools for Docker. When I select my project (ASP.NET Core Web Application (.NET Core)) and right-click Add->Docker Support, then I get error message: 'docker' was not found. Please verify that the path exists: C:\Program Files\Docker\Docker\Resources\bin\docker.exe
Can you verify if 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe' actually exists?
In addition, the Docker tools for Visual Studio has dependency on Docker for Windows since 0.40, which requires to run on Windows 10 Professional or Enterprise 64-bit.
So we could not use Docker Toolbox? Only Docker for windows is supported? I am doing other stuff with Virtual Box which needs Hyper-V turned off so I prefer using Docker Toolbox on windows. Isn't there a work around or any settings to use this with this Exension?
No, 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe' doesn't exists on my machine. It's because I have Windows 7 and there is not possible to install Docker for Windows.
1) Would be possible to use Visual Studio Tools for Docker on Windows 7?
2) If not, is it possible to download older version of Visual Studio Tools for Docker, e.g. 0.31?
Unfortunately, we currently support Windows 10. Attempting to support multiple variations makes it difficult to iterate on features, and we're taking advantage of Docker for Windows features. Including the removal of docker-machine.
We realize this makes it difficult for customers that haven't yet moved to Windows 10. The theory, and we appreciate theories don't apply to all, is: if you're doing docker work, your pretty much on the cutting edge. So, at this point, we do depend on Win 10 Pro.
Hi Steve, can you also answer my question.
I am on windows 10 pro but I am doing other stuff with Virtual Box which needs Hyper-V turned off so I prefer using Docker Toolbox on windows. Isn't there a work around or any settings to use Docker Toolbox with this Exension?
We are looking to remove the hard dependency on Docker for Windows. We are dependent on Volume Mapping and a local host. We'd have to do more work to support other docker hosts as our tools assume http://localhost. It's possible you could use DOCKER_ environment variables, but it's not something we're currently testing.
But, I do hear your desire and we can look at simple fixes.
I'm trying to debug from Visual Studio 2015 Update 3 with Visual Studio Tools for Docker - Preview and Docker for Windows version 1.12.0-stable and always see en Output Windows Trying to connect to http://localhost...
C:\Users\luis_\Documents\PublishToDocker\src\PublishToDocker\DockerTask.ps1 -Run -Environment Debug -Machine '' -RemoteDebugging $True -OpenSite $False
VERBOSE: Setting: $env:CLRDBG_VERSION = "VS2015U2"
VERBOSE: Setting: $env:REMOTE_DEBUGGING = 1
Stopping conflicting containers using port 80
VERBOSE: Executing: docker stop 61b2429ba4f0
VERBOSE: Executing: docker-compose -f
ose.debug.yml' -p publishtodocker up -d
C:\Users\luis_\Documents\AspNetCoreBook\proyectos\PublishToDocker\src\PublishToDocker\DockerTask.ps1 -WaitForUrl -Machine ''
VERBOSE: Setting: $env:CLRDBG_VERSION = "VS2015U2"
VERBOSE: Setting: $env:REMOTE_DEBUGGING = 0
Opening site http://localhost/ Trying to connect to http://localhost/ (0/120)
Trying to connect to http://localhost/ (1/120)
Trying to connect to http://localhost/ (2/120)
Trying to connect to http://localhost/ (3/120)
Trying to connect to http://localhost/ (4/120)
Trying to connect to http://localhost/ (5/120)
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2ca11d40065f username/publishtodocker:Debug "/bin/bash -c 'if [ \"" 13 hours ago Up About an hour 0.0.0.0:80->80/tcp publishtodocker_publishtodocker_1
If I run the powershell in release configuration I can access to http://localhost and see my ASP.NET MVC Core app running.
Yep, can confirm, same here. I assume some sort of problem with VS connecting to the debugger or something.
It works in release because kestrel is started, but when debugging, kestrel is not (directly) started and instead, I guess, it waits for VS to connect to the debugger. Which doesn't for some reason.
Have been looking at the same issue fo a few days now. It seems to be some issue running docker exec ultimately. If you look in the output from debug instead of build/docker, you will find a error 'No executable found matching command "dotnet-/app/MyProject.dll"'. I tried running it manually from command line, and confirmed the issue using docker exec. instead of actually running "dotnet /app/MyProject.dll" it takes the second parameter and adds it using dash so it becomes "dotnet-/app/MyProject.dll"
Just wanted to pass on the below, I had the same situation you're experiencing and this fixes it for me. I can kick off debug now and it attaches.
Nathan Carlson [ncarlson@MSFT] Graeme Baker • 30 minutes ago
Try removing the volumes section from your docker-compose.debug.yml file. Volume mapping is used locally to enable the Edit & Refresh scenario, but does not work remotely.
I keep getting the error:
Error Running: powershell -NonInteractive -ExecutionPolicy RemoteSigned .\DockerTask.ps1 -Build -Environment Debug -Machine '' -ClrDebugVersion VS2015U2. See the output window for details.
I've run the command "Set-ExecutionPolicy unrestricted" as an admin from a PowerShell console but keep running into the issue.
Has anyone else run into this? My fear is that it's a group policy affecting me.
I'm trying to debug from VS 2015 Update 3, using this extension, and Docker for Windows v1.12. I can build a Docker image just fine, but when I try to debug, docker-compose fails with the message:
'D:\Projects\web\src\Web\bin\Docker\Debug\app\docker-compose.debug.yml' -p web up -d
Error calling docker-machine ip for docker machine . Check to see if it is running and accepting connections.Security error.
This is odd to me - it seems like the script should be ignoring checks to docker-machine because I haven't supplied a machine name. This extension always seems to execute this command:
D:\Projects\web\src\Web\DockerTask.ps1 -Run -Environment Debug -Machine '' -RemoteDebugging $True -OpenSite $False
When I debug with Docker. If I run DockerTask.ps1 on the command line (without the -Machine flag), I can start up the container successfully but the script starts hanging with "Trying to connect to http://localhost/ (1/120)" (See Luis Ruiz Pavon's problem below).
Anybody else running into this issue?
Is there any way to enable debugging on a remote instance? The local virtualbox install trashed my networking and I had to remove it.
I have a vm set up on AWS and would like to use it for debugging purposes.
Also, 'how' do you change the build options that are passed into RunDockerTask.ps1 on a debug build? Setting the $DockerMachineName in Docker.props does not take (even after restarting VS like it asks to), and the build line in properties doesn't seem to be used at all. I need to change it to not try opening the site (it's a REST API with authentication middleware that can't be set in a regular browser session).
So I have not been able to figure out why changing $DockerMachineName in Docker.props isn't changing what is passed. What I have done in the meantime as a band-aid is change the docker.targets file to hard code the machine name. This seems to work for now but I am still looking into why the changing the setting doesn't seem to have any effect.
I finally was able to get the Docker Toolbox VM running, and was able to debug to it after hardcoding everything I needed set in DockerTask.ps1 (machine name, remote debug). It still sits there spinning trying to open the site in Edge, but at least it works now. There needs to be a clear and simple way to change all of the options that get passed to that power shell script on a build through VS, because right now everything I try modifying doesn't seem to have any effect at all.
The default settings, however, do not work AT ALL. It's constantly trying to pass in a blank machine name, and not using 'default' by default, so it fails to build because it can't connect.
Hi, I wanted to ask if it's possible to run tests inside the docker container, or at least integration tests (separate project) - since my project needs some local applications to be installed and configured and I don't want to do it on every developer machine.
Of course I could script things together, but than I'd loose the opportunity of running tests automatically after compilation as well as seeing the results in the test explorer.