Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to show a helpful error message with an invalid OS version in the TFM #16802

Closed
rolfbjarne opened this issue Nov 17, 2022 · 6 comments · Fixed by #18931
Closed

Try to show a helpful error message with an invalid OS version in the TFM #16802

rolfbjarne opened this issue Nov 17, 2022 · 6 comments · Fixed by #18931
Labels
enhancement The issue or pull request is an enhancement
Milestone

Comments

@rolfbjarne
Copy link
Member

Ref: dotnet/maui#11333

Customer used net7.0-15.4 and the app crashes at launch.

We should look into whether it's possible to detect this scenario, and show a build error instead (and maybe even list the valid versions).

@jasonleach
Copy link

This same error showed up using net7.0-15.2 as well for me. or net7.0-14.5 or about anything else I tried.

@rolfbjarne
Copy link
Member Author

@jasonleach just use net7.0 (without -<version>), that should work fine.

@tranb3r
Copy link

tranb3r commented Dec 19, 2022

Why is it crashing when we specify a TFM version for net7.0-ios ?
How do we know which version is used if we do not specify it ?
https://learn.microsoft.com/en-us/dotnet/standard/frameworks#os-version-in-tfms

@rolfbjarne
Copy link
Member Author

Why is it crashing when we specify a TFM version for net7.0-ios ?

We don't support all possible OS versions, just a very limited set. If you pick one we don't support, things won't work.

How do we know which version is used if we do not specify it?

Typically it's the latest OS version that's been released by Apple (with some delay as we implement and release support for that version). It's also possible to find the exact version in the build log, although it's usually not necessary. Do you have a specific reason for wanting to know?

@rolfbjarne
Copy link
Member Author

rolfbjarne commented Sep 6, 2023

This will be fixed with #18931.

@rolfbjarne rolfbjarne linked a pull request Sep 6, 2023 that will close this issue
rolfbjarne added a commit that referenced this issue Sep 6, 2023
Multi targetting is described here:
/~https://github.com/xamarin/xamarin-macios/blob/main/docs/multi-target-framework.md

This change implements support for:

* Building using the first .NET 7 packages we shipped.
* Building using the last .NET 7 packages we've shipped.

In both cases by specifying the OS version in the target framework.

Additionally adding support for any other API/OS version is trivial: it's just
a matter of listing the corresponding versions in a few files (this is
particularly interesting to add support for preview versions).

It does so by:

* Renaming the ref, sdk and runtime packs to contain the target framework and
  the target platfrom version, so the packages will now be named:

    * iOS

        * Microsoft.iOS.Sdk.net8.0_16.4
        * Microsoft.iOS.Ref.net8.0_16.4
        * Microsoft.iOS.Runtime.ios-arm64.net8.0_16.4
        * Microsoft.iOS.Runtime.iossimulator-arm64.net8.0_16.4
        * Microsoft.iOS.Runtime.iossimulator-x64.net8.0_16.4

    * tvOS

        * Microsoft.tvOS.Sdk.net8.0_16.4
        * Microsoft.tvOS.Ref.net8.0_16.4
        * Microsoft.tvOS.Runtime.ios-arm64.net8.0_16.4
        * Microsoft.tvOS.Runtime.iossimulator-arm64.net8.0_16.4
        * Microsoft.tvOS.Runtime.iossimulator-x64.net8.0_16.4

    * Mac Catalyst

        * Microsoft.MacCatalyst.Sdk.net8.0_16.4
        * Microsoft.MacCatalyst.Ref.net8.0_16.4
        * Microsoft.MacCatalyst.Runtime.maccatalyst-x64.net8.0_16.4
        * Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.net8.0_16.4

    * macOS

        * Microsoft.macOS.Sdk.net8.0_13.3
        * Microsoft.macOS.Ref.net8.0_13.3
        * Microsoft.macOS.Runtime.osx-x64.net8.0_13.3
        * Microsoft.macOS.Runtime.osx-arm64.net8.0_13.3

* Updating the WorkloadManifest.json and WorkloadManifest.targets files to
  load the correct packs according to the TargetFramework in the developer's
  project.

* We're also now giving a better error message for invalid/unsupported/eol'ed
  target frameworks. Fixes #18790.

* Add a few tests.

Fixes:
* #18790.
* dotnet/sdk#30103.
* #16802.

Contributes towards:

* #18343.
@rolfbjarne
Copy link
Member Author

Fixed with #18931.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue or pull request is an enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants