I have a Web API app written on the top of ASP.NET Core 3.1 framework that I want to run using docker. When I click "Run" using docker, Visual studio fails and logs the following to the debug-window.
C:\Users\myusername.nuget\packages\microsoft.visualstudio.azure.containers.tools.targets\1.9.10\build\Container.targets(198,5): error CTC1003: Visual Studio container tools require Docker to be running
When looking at the log prior to that error, I can see that VS is trying to run the docker image using the following command
docker run -dt -v "C:\Users\myusername\vsdbg\vs2017u5:/remote_debugger:rw" -v "C:\WinProjects\ProjectName\ProjectName:/app" -v "C:\WinProjects\ProjectName:/src" -v "C:\Users\myusername\AppData\Roaming\Microsoft\UserSecrets:/root/.microsoft/usersecrets:ro" -v "C:\Users\myusername\AppData\Roaming\ASP.NET\Https:/root/.aspnet/https:ro" -v "C:\Users\myusername\.nuget\packages\:/root/.nuget/fallbackpackages2" -v "C:\Program Files\dotnet\sdk\NuGetFallbackFolder:/root/.nuget/fallbackpackages" -e "DOTNET_USE_POLLING_FILE_WATCHER=1" -e "ASPNETCORE_ENVIRONMENT=Development" -e "ASPNETCORE_URLS=https://+:443;http://+:80" -e "NUGET_PACKAGES=/root/.nuget/fallbackpackages2" -e "NUGET_FALLBACK_PACKAGES=/root/.nuget/fallbackpackages;/root/.nuget/fallbackpackages2" -P --name ProjectName --entrypoint tail projectname:dev -f /dev/null
But that command throws the following error
docker: Error response from daemon: invalid volume specification: 'C:\Users\myusername\AppData\Roaming\ASP.NET\Https:/root/.aspnet/https:ro'.
How can I fix this issue and run a Docker image from Visual Studio 2019?
Using the Package Manager Console
in Visual Studio, The following command work with no issues.
docker ps
docker-machine status
I don't understand why Visual Studio is throwing error CTC1003: Visual Studio container tools require Docker to be running
I also executed ps kill
to all images found by running docker ps
. I also ran docker system prune -a
to clean up everything. but still the same issue.
Additionally, I added docker-compose
project to my solution. When it runs I get the following error
-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.
The program 'dotnet' has exited with code 145 (0x91).