Shay Katz
Shay Katz

Reputation: 141

Docker Startup Error on Windows 10: Object reference not set to an instance of an object

When starting Docker on Windows 10, I saw the error:

Object reference not set to an instance of an object.

After searching for a while, I found a blog post that describes how to get rid the error: Error while starting Docker for Windows, which is to delete all the files in

C:\Users\<UserName>\AppData\Roaming\Docker\

The blog post references a Docker GitHub issue (Object reference not set to an instance of an object when starting docker for windows) which has other solutions.

Upvotes: 11

Views: 7472

Answers (4)

Jineapple
Jineapple

Reputation: 675

One more thing to check is your Project.csproj.user file. In my case, the ActiveDebugProfile was set to Local. Changing this to Docker fixed the issue.

Upvotes: 0

Kei
Kei

Reputation: 1364

Originally I was using version 1.17.0 of the Microsoft.VisualStudio.Azure.Containers.Tools.Targets package in Visual Studio 2022. Upgrading to version 1.18.1 fixed this issue for me but only by first uninstalling the previous version. Simply upgrading via the NuGet Package Manager interface did not work:

  1. Open the Package Manager Console in Visual Studio.
  2. Run: Uninstall-Package Microsoft.VisualStudio.Azure.Containers.Tools.Targets
  3. Run: Install-Package Microsoft.VisualStudio.Azure.Containers.Tools.Targets

Upvotes: 1

Giom
Giom

Reputation: 21

For the people who are needlessly looking for a solution and the solution with removing folders under appdata did not work. I got it working for myself by removing the regkeys that contained docker.

Upvotes: 2

Pavel S.
Pavel S.

Reputation: 1224

Today after Docker Desktop's update on Windows 10 I got this issue (NullReferenceException). When I deleted (by previously saving it of course) the mentioned folder I stopped seeing my containers when doing docker ps -a.

A deeper investigation showed that the issue was with "overrideProxyExclude": null property in my C:\Users\<UserName>\AppData\Roaming\Docker\settings.json. Simply changing its value to an empty string "overrideProxyExclude": "" fixed the problem. This way I avoided removal of the whole folder which kept my local setup.

Upvotes: 0

Related Questions