Unable to find the target operating system for the project

Hi everyone,

I ran into the following error today after updating visual studio 2019 to version 16.6:

unable to find the target operating system for the project

I tried a fair few things to get this going again and I’m assuming they’re not all necessary, but I’ll list them just in case:
– Clean solution
– Close visual studio
– Delete .vs folder
– Ensure that docker-compose is set as startup project
– Edit each project’s .csproj file and ensure that the DockerDefaultTargetOS value is set: Linux
– Edit docker-compose.dcproj and ensure that DocketTargetOS is set
– Restart computer

If you’re able to narrow it down at all I’d be interested in hearing what the actual cause is!

Cheers,
Chris

Comments

3 responses to “Unable to find the target operating system for the project”

  1. Kibble Avatar
    Kibble

    I removed the DockerDefaultTargetOS entry and deleted the launch settings file to get it working, then I suppose you can add the features back as you need.

    Liked by 1 person

  2. Babak Avatar
    Babak

    Try change the project to target Project instead of Docker. That should changelaunchSettings.json:
    {
    “profiles”: {
    “Intelex.Automation.DataImport”: {
    “commandName”: “Project”
    },
    “Docker”: {
    “commandName”: “Project”
    }
    }
    }

    Like

  3. YediJedi Avatar
    YediJedi

    I came across this developing on a windows machine using VS 2022 Enterprise. The version of ubuntu used by the Windows Subsystem for Linux (WSL) was old and did not support .NET6 (the version of .NET that my VS project was targeting) See https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#supported-distributions. I upgraded ubuntu used by WSL to the latest LTS version and the error went away.

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com

%d bloggers like this: