Skip to content

xcode-select : error : tool 'xcodebuild' requires Xcode - new error with nativeaot in .NET 9 preview 2 #100189

@LLT21

Description

@LLT21

With the following project file settings:

    <TargetFramework>net9.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <PublishAot>true</PublishAot>
    <RuntimeIdentifier>osx-arm64</RuntimeIdentifier>

when publishing in release mode, I receive the following errors on my Mac M1 with .NET 9 preview 2, which I do not have with previous versions:

Restore complete (0,3s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  lib2 failed with errors (0,3s) → bin/release/net9.0/osx-arm64/lib2.dll
    xcode-select : error : tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance [/Users/llt/Projects/dotnetoni/libs/lib2/lib2.csproj]
    /Users/llt/.nuget/packages/microsoft.dotnet.ilcompiler/9.0.0-preview.2.24128.5/build/Microsoft.NETCore.Native.Unix.targets(243,24): error MSB4086: A numeric comparison was attempted on "$(_XcodeVersion)" that evaluates to "" instead of a number, in condition "'$(_XcodeVersion)' >= '15'". [/Users/llt/Projects/dotnetoni/libs/lib2/lib2.csproj]

Build failed with errors in 0,8s

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions