Skip to content

AOT publish on macOS arm64 fails on .NET 11 with xcode-select/xcodebuild error #133476

Description

@WeihanLi

Description

Publishing AOT artifacts on macOS arm64 fails on .NET 11 RC1 with xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance.

The same app/environment works when changing only TargetFramework from net11.0 to net10.0.

This may be related to #100189, but this report is for .NET 11 behavior.

Reproduction Steps

dotnet new console -n aot-publish-test

The template "Console App" was created successfully.

Processing post-creation actions...
Restoring /Users/weihan.li/test/aot-publish-test/aot-publish-test.csproj:
Restore succeeded.

cd ./aot-publish-test/ && cat ./aot-publish-test.csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net11.0</TargetFramework>
    <RootNamespace>aot_publish_test</RootNamespace>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

</Project>

dotnet publish -p PublishAot=true

Restore complete (1.4s)
    info NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  aot-publish-test net11.0 osx-arm64 succeeded (2.8s) → bin/Release/net11.0/osx-arm64/publish/
    xcode-select : error tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Build failed with 1 error(s) in 4.5s

Expected behavior

Publish should success

Actual behavior

Publish fails with:

xcode-select : error tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Regression?

Change only TargetFramework to net10.0 and run the same publish command; publish succeeds.

Works when updating target framework to net10.0 and with .NET 10 SDK

dotnet publish -p PublishAot=true

Restore complete (0.1s)
    info NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  aot-publish-test net10.0 osx-arm64 succeeded (2.0s) → bin/Release/net10.0/osx-arm64/publish/

Build succeeded in 2.1s

Known Workarounds

No response

Configuration

.NET SDK:
 Version: 11.0.100-rc.1.26425.128
 Commit: 3551975be0
 Workload version: 11.0.100-manifests.a6e318ce
 MSBuild version: 18.11.0-1.26425.128+3551975be

Runtime Environment:
 OS Name: Mac OS X
 OS Version: 26.6
 OS Platform: Darwin
 RID: osx-arm64
 Base Path: /Users/weihan.li/Library/Application Support/dotnet/sdk/11.0.100-rc.1.26425.128

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
 Version: 11.0.0-rc.1.26425.128
 Architecture: arm64
 Commit: 3551975be0

.NET SDKs installed:
 10.0.401
 11.0.100-rc.1.26425.128

.NET runtimes installed:
 Microsoft.AspNetCore.App 10.0.12
 Microsoft.AspNetCore.App 11.0.0-rc.1.26425.128
 Microsoft.NETCore.App 10.0.12
 Microsoft.NETCore.App 11.0.0-rc.1.26425.128

Environment variables:
 DOTNET_ROOT=/Users/weihan.li/Library/Application Support/dotnet

Other information

Possibly related to closed issue #100189 (xcode-select : error : tool 'xcodebuild' requires Xcode - new error with nativeaot in .NET 9 preview 2).

sdk issue created before: dotnet/sdk#55296

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions