dotnet / dotnet/macios

Unhelpful message after upgrading 8.0 app to 9.0

Open
#21,204 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
2.9k
Forks
576
Avg merge
2d 12h
Merged PRs (30d)
123

Description

### Apple platform

Mac Catalyst

### Framework version

net9.0-*

### Affected platform version

9.0.100-preview.7.24407.12

### Description

Upgrading an 8.0 MAUI app to 9.0 by changing TFMs to `net9.0` and then trying to run it as maccatalyst produces a confusing error and suggest a fix which is at best misleading.

(The repro steps will produce the below error)

```
ILLink : unknown error IL7000: An error occured while executing the custom linker steps. Please review the build log for more information.
ILLINK : error MT0073: Microsoft.MacCatalyst 17.5.9231 does not support a deployment target of 13.1 for MacCatalyst (the minimum is 15.0). Please select a newer deployment target in your project's Info.plist.
ILLINK : error MT2301: The linker step 'Setup' failed during processing: Microsoft.MacCatalyst 17.5.9231 does not support a deployment target of 13.1 for MacCatalyst (the minimum is 15.0). Please select a newer deployment target in your project's Info.plist.
```

Several problems with this:
- `ILLink` - normal users should not need to know what this is and it's just confusing. Additionally this doesn't feel like the right place to report this kind of problem. Ideally this should be done by the SDK earlier on, the linker custom step doesn't necessarily have enough context to produce a helpful error message.
- The errors are not documented - or at least not findable. Searching bing for `MT0073` doesn't produce anything useful. Same goes for `IL7000`. Ideally we should include a URL which points to more details about the problem.
- The suggested fix is to update `Info.plist` - this file does exist in a MAUI template app, but it doesn't contain the version number - just variable references. Changing it is very likely not the correct fix. The correct place to fix in this case seems to be to modify the `.csproj` which defines `SupportedOSPlatformVersion`. It is possible that this correct fix depends on the project type (MAUI versus just iOS and so on), but at least MAUI is probably the majority of users and thus should be included.
- Nit `occured` word in the `IL7000` message is misspelled - should be `occurred`.

### Steps to Reproduce

On .NET 8 SDK - `dotnet new maui`
Open the `.csproj` and update all TFMs to `net9.0`.
Using .NET 9 SDK - `dotnet build /t:Run -f net9.0-maccatalyst`

### Did you find any workaround?

_No response_

### Relevant log output

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.