Skip to content

Failure during CLI build after VS Upgrade #26452

Description

@divil5000

Apple platform

iOS

Framework version

net9.0-*

Affected platform version

.net 9

Description

We just upgraded from a stable build environment with VS2022, to the new VS2026. We are leaving our main application targeting .net 9 for the time being. Part of the upgrade meant updating XCode to 26.5 on the paired Mac, so it has been a significant change of environment.

VS2026 successfully pairs to the Mac, and we can do F5 build-and-debug runs successfully as well as build and deploy Release builds for internal testing. No problems there.

Unfortunately, our CLI build script for production builds is now broken. It fails with the following error:

C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net9.0_26.5\26.5.9002\tools\msbuild\Xamarin.Shared.targets(2025,3): error Could not find Microsoft.iOS in /Users/redacted/Library/Caches/Xamarin/XMA/SDKs/dotnet/packs/Microsoft.iOS.Sdk.net9.0_26.5/26.5.9002/.

I have looked in that "packs" folder and there are "Microsoft.iOS.Sdk.net9.0_18.0" and "Microsoft.iOS.Sdk.net9.0_26.0" entries, but indeed not the 26.5 one it is looking for. I do not understand how it has ended up like this, and being someone who relies upon VS to get the environment set up correctly on the Mac, I do not know how to fix it.

The command we are using to build/publish is below.

dotnet publish -f:net9.0-ios -p:ArchiveOnBuild=true -p:ServerAddress=redacted -p:TcpPort=58181 -p:ServerUser="redacted" -p:_DotNetRootRemoteDirectory="/Users/redacted/Library/Caches/Xamarin/XMA/SDKs/dotnet/" -p:CodesignKey="redacted" -p:CodesignProvision="redacted" /p:DotNetRuntimePath="/usr/local/share/dotnet/dotnet" /p:ServerPassword="redacted"

I seem to recall this happened once before, but cannot remember how I fixed it. I think someone advised manually copying some files from one location on the Mac to another.

Needless to say, this has broken our ability to deploy our app, so we are stuck.

Steps to Reproduce

I cannot imagine how one would reproduce this.

Did you find any workaround?

No response

Build logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    need-attentionAn issue requires our attention/responsewindows-onlyThe issue only occur on Windows

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions