I've been playing with docker for a while and was pleased to see the new tools in VS2017. I've had issues before with docker for windows but I can't see why this one is happening.
I create a webapp just straight from the box and add docker support. I then simply try and launch it with no changes and I get the following error.
I have checked that the container is registered and it does look to have gotten that far:
a quick docker ps -a yields this:
The thing is the error reporting appears to be trying to deploy from a build path does does indeed not exist (my projects are on my G drive not F, that is where visual studio is installed).
So what gives? I can run the docker-compose from the command line inside the project path and then docker-compose up and it seems fine. Seems visual studio is just using the incorrect path, not sure why.
Version in use are:
Docker for windows 17.04.0-ce-rc2-win6(10840)
Visual studio 2017: Version 15.1(26403.0)
I checked again which version of docker I was using and I was using from the edge stream. I fell back to stable and this issue went away.
I had the same problem. It turns out solution told above of reverting to Docker stable version solved it. With Edge version, the build looks for solution file in the VS IDE folder instead of current folder.
Related
On our new company laptops we are running into issues running containers in docker desktop from visual studio. We tried a bunch of things which were unsuccessful. Any help / thoughts would be great as we are running out of ideas.
.Net Core Version 6 / Asp.net Core (web api)
Running docker compose manually in cmd works and I'm able to hit the site.
Running docker compose debug profile from visual studio results in:
The output window shows "The program '' has exited with code 4294967295 (0xffffffff)."
Docker desktop shows the container running but I can't grab logs from it or hit it in the url.
WSL is fine and everything is working there.
My home machine works great and i'm able to launch and debug containers.
Faced with identical error, I was able to resolve by deleting VSDBG debugger folder:
%USERPROFILE%\vsdbg\vs2017u5
After deleting the folder start Visual Studio debugger (F5) and as a result VSDBG debugger will be recreated
Container Tools build properties https://learn.microsoft.com/en-us/visualstudio/containers/container-msbuild-properties?view=vs-2022
I have the same error when I'm trying to start 2 project simultaneously. And one project was cloned from another. So, they have the same GUIDs of projects in .sln files. After changing GUIDs all works ok.
Most of the time this error code does not provide any concrete information. In my case I had to go and find error details in logs folder. Log file is generally located at 'YourProject\bin\Debug\App_Data\Logs' location.
There was an issue with 3rd party service and it worked after fixing the service issue.
I have a full Docker image that has Flutter SDK, Android SDK, Dart SDK, etc, all installed and in the $PATH.
I made it work on Intellij Idea, I can click "deploy" and it launches, but then I don't know what else to do.
I thought Intellij Idea would work inside this container, and so it would find Dart SDK, etc, and work.
How can I compile my flutter project using the SDK from the container on Intellij Idea? And also how to use intellisense, etc, all from things inside the container
Seems like this is not something that is currently supported in IntelliJ, according to a forum-post answered by JetBrains staff.
How I see it, you have three options:
Switch to Visual Studio Code and follow these instructions
Use the in the forum-post mentioned Projector, which runs your IDE on a Server and you can connect to it using a web browser, or a Electron desktop client
Expose your SDKs from your Docker container and set the paths manually on your host system
With #3 I mean something like this, when running your container:
docker container run -itd \
-v /local/path/to/sdk:/docker/path/to/sdk \
devimage
and then in your IDE you can set the path to that, or you could even set some environment variables like e.g. ANDROID_HOME to point to the local bind location.
You may try this.
Go to File -> Project Structure
Set the path for Module, Library, Project, and SDK
Sometimes IntelliJ requires the PATH setup here.
I am working on .Net core Microservices. I installed Docker Toolbox containing docker cli and kitematics. After that i created a simple (.Net core) web api project in visual studio 2017 and also enable docker support.
But when i hit F5 to run the program it shows following error and doesn't run.
Visual Studio Container Tools requires Docker to be running before building, debugging or running a containerized project.
Please review the attached image.
Visual studio error on running the project
If i build and run the project using docker cli, it's working. The problem is with visual studio 2017.
In my case I had an erroneous reference in Dependencies > Packages to Microsoft.VisualStudio.Azure.Containers.Tools.Targets
Removing the reference fixed the error.
The problem occurs because Visual studio container is unable to connect to docker for windows and solution for this is to open the visual studio 2017 from Docker CLI using following command.
/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/Community/Common7/IDE/devenv.exe C:\\PATH\\TO\\MY\\SOLUTION.sln
Here:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe
is the location of my devenv.exe file and 2nd parameter
C:\\PATH\\TO\\MY\\SOLUTION.sln
shows the path of solution file.
For further details of this solution, click Here.
In my case, this issue was caused by a disabled BIOS Virtualization. To enable Virtualization, see here. In order to check whether Virtualization is already enabled, start Task Manager > Performance > find Virtualization. If you are hosting your docker container application in full feature IIS, make sure you start Visual Studio as an Administrator.
I was getting the same error when I was trying to rebuild my solution after changing my .Net Core 2.0 application to .Net Core 2.2. As I reset my windows, there was no docker installed on my machine. To fix this all I had to do is to install the docker for desktop as I wanted to containerize my applications.
Once you install the Docker, it will ask you to enable Hyper-V and Container features. By clicking the Ok button in the pop up as preceding, will enable this features for you.
Your computer will be restarted automatically and once it is done, you should be able to see that the Virtualization is enabled in the task bar.
After this I was not facing this error.
Check shared folders inside the default virtual machine setting in Virtual box to make sure you shared the disk where you project located. By default shared only C:\Users. So alternatively you can move your project somewhere inside C:\Users folder (for example in Desktop folder)
I was facing the same issue and I resolved it by switching to IIS Express instead of Docker in debug menue on visual studio 2017
I created a new .NET Core Console Application with Visual Studio 2017 (RTM). Then added Docker support and got the docker file + compose files just fine. However there are few issues with them.
Docker compose files have version 2 which makes the build fail to the following error message
Microsoft.DotNet.Docker.CommandLineClientException: client version 1.22 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version.
This can be fixed by manually changing the compose file versions to 2.1. (not sure if valid fix) Then you'll get another error message
MSB4006 There is a circular dependency in the target dependency graph involving target "DockerCleanServiceReferences".
This I have no idea how to fix. I know the error message is due to some configuration that causes circular reference (e.g. post build event that does build)
So, any resources or tips how to package the .NET Core console application into docker container manually? I'm just getting to know Docker so don't assume I know anything of it yet.
Another question, that is there some place where I could get updated versions of these Visual Studio templates or are these known issues?
It turned out the problem for me was having my DockerFile, SLN file, and CSPROJ file all in the same folder. You know how when you create a solution, it asks you if you want to create a subdirectory? If you do not, and your SLN and CSPROJ files share the same folder, inevitably the Docker files will be added to this same folder, creating the circular reference. If your SLN file lives in the directory above your CSPROJ file, the DockerFile et al will be put into your parent directory with the SLN file, and all will be well. This solved it for me.
Can you please check if your Docker for Windows is targeting Linux? It's likely you were targeting Windows container, which is not supported with .NET Core yet.
On my first spin of VS2017 with docker, using the default template, I ran in to the same issue.
I referred to this article - https://blogs.msdn.microsoft.com/containerstuff/2017/03/13/visual-studio-2017-client-version-1-22-is-too-old/
This is what worked for me - As recommended, made this changes in docker-compose project's docker-compose.ci.build.yml :
The 'version' parameter on the top of the file which was set to 2, was change to 2.1
Repeated the same changes on the other files in the project including:
docker-compose.yml
docker-compose.override.yml
docker-compose.vs.debug.yml
docker-compose.vs.release.yml
Regarding your question on how to package a .NET Core console application into a Docker image manually. The https://github.com/dotnet/dotnet-docker-samples are intended to answer that very question. Check them out. If you run into issues with them or have suggestions please log an issue (https://github.com/dotnet/dotnet-docker-samples/issues).
Thanks for the post. We will be adding Nano Server container tooling "soon". Until then, you can work with Linux containers which will give a similar experience.
I took a clean machine (Windows 10 Enterprise w/out the Anniversary Update) 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. When I run (F5) all works as expected. I then right clicked on the project and went to Add->Docker Support. Now when trying to run (F5) using Docker I see this error message:
MSB4018 The "PrepareForCompile" task failed unexpectedly.
Microsoft.DotNet.Docker.CommandlineClientException: Error response
from daemon: Container ... is not running at ...
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 --rm -v c:/Users:/data alpine ls /data
the response is empty.
Likewise when I try using busy box the directory is empty.
docker run -it -v /C/Users:/wormhole busybox
cd wormhole
ls
I have tried using Windows Desktop for Docker 1.12.1-stable and beta 26. Both have the same issue.
Some have indicated that Antivirus could cause a problem. I do have Mcafee installed, but I cannot uninstall or disable the antivirus software.
Some have suggested that passwords with unusual characters can cause this issue but that does not apply here.
I don't know that shared drives are causing the VS2015 error, but it seems like a good place to start since shared drives are broken.
I have restarted bot hdock and the computer many times, to no avail.
Any Ideas?
I had the same issue.
In order to fix it I found the container referenced by the id in the stack trace. Then I removed it:
docker rm <containerid>
When I tried running from VS 2015 again it worked. I don't know what initially caused the issue.
I just wanted to add since I also stumbled upon this issue. I had a clean Win 10 machine, and I just had to enable the "Shared Drive" setting in docker:
This may not be the actual problem that you're facing (Thankfully you fixed it!); this is just for people that may not have this enabled!