How did I do?*

Failed to launch debug adapter

 

Error when trying to launch a Docker Compose project
Error when trying to launch a Docker Compose project

 

One or more errors occurred.

Failed to launch debug adapter. Additional information may be available in the output window.

The operation was canceled.

And the useful error details which follow?

The program '' has exited with code 4294967295 (0xffffffff).

This error appeared because I got another one first:

System.Globalization.CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')

The solution to which is to disable invariant culture by declaring the environment variable DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=0.

If you don't need globalisation, the simple solution is to explicitly enable invariant culture by defining the above variable with 1 or true as the value, however if you do need it, e.g. for different languages, cultural formatting for dates, currencies etc., then follow these steps:

  1. Open: View > Other Windows > Command Window
  2. Enter DebugAdapterHost.Logging /On /OutputWindow
  3. Run your project again, then check the output from "Debug Adapter Host Log"
  4. Read the much more useful error message
ERROR: Debug adapter error output: Process terminated. Couldn't find a valid ICU package installed on the system. Please install libicu (or icu-libs) using your package manager and try again. Alternatively you can set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support. Please see https://aka.ms/dotnet-missing-libicu for more information.

You can remedy this by either:

  1. using a full aspnet base image rather than the lightweight alpine variant, or
  2. adding the following instructions to your Dockerfile
RUN apk add icu-libs icu-data-full # for everything
RUN apk add icu-libs icu-data-en # for just en-US/en-GB

# You may also need the following for timezone related stuff
RUN apk add tzdata