I am using VS 2022 .Net 8 to create a container image of ASP.Net Web API application but dot net publish command is failing

Priyadarshi, Pankaj 0 Reputation points
2025-02-21T13:53:46.1433333+00:00

I am using VS 2022 .Net 8 to create a container image of ASP.Net Web API application but dot net publish command is failing with below error:

Building image 'dockerdemo' with tags 'latest' on top of base image 'mcr.microsoft.com/dotnet/aspnet:8.0'.

C:\Program Files\dotnet\sdk\8.0.400\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error : Cannot find

docker/podman executable. [C:\Projects\DockerDemo\DockerDemo.csproj]

C:\Program Files\dotnet\sdk\8.0.400\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error CONTAINER1012

: The local registry is not available, but pushing to a local registry was requested. [C:\Projects\DockerDemo\DockerDemo.csproj]

I don't have Docker Desktop on my machine and I guess it is not mandatory to have the image created.

Please suggest.

Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
1,025 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.