This repository was archived by the owner on May 6, 2024. It is now read-only.
[net8.0] fix C# compiler error involving x:Name#242
Merged
jonathanpeppers merged 9 commits intonet8.0from Oct 23, 2023
Merged
Conversation
Context: dotnet/maui#5611 Fixes: #239 The `net8.0` branch currently fails to build with: src/Mobile/Controls/Player.xaml.cs(54,9): error CS0103: The name 'podcastImage' does not exist in the current context src/Mobile/Controls/Player.xaml.cs(55,9): error CS0103: The name 'duration' does not exist in the current context We think that `x:Name` in .NET 8 appropriately "skips" emitting fields when used in combination with `<OnPlatform/>`. We can condition the C# code accessing these files with `#if WINDOWS || MACCATALYST` to solve this. There are also a lot places using `<On Platform="UWP, macOS">`, we could consider cleaning these up in a future PR.
Member
Author
|
There are errors on Catalyst now: I'll go through some more of these tomorrow. |
ivanpovazan
reviewed
Oct 19, 2023
error NETSDK1147: To build this project, the following workloads must be installed: wasi-experimental
Member
Author
|
Some reason today, the nightly builds are getting: Will investigate tomorrow, this is a new/different problem. |
Member
Author
|
I fixed this just by using our .NET 8 RC 2 builds, instead of nightly builds. I think we are at a point this branch should just use the released bits. |
ivanpovazan
approved these changes
Oct 23, 2023
Member
ivanpovazan
left a comment
There was a problem hiding this comment.
According to macOS -> MacCatalyst changes, should we also change:
Apart from that, looks good, and thank you for looking into this!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context: dotnet/maui#5611
Fixes: #239
The
net8.0branch currently fails to build with:We think that
x:Namein .NET 8 appropriately "skips" emitting fields when used in combination with<OnPlatform/>.We can condition the C# code accessing these files with
#if WINDOWS || MACCATALYSTto solve this.There are also a lot places using
<On Platform="UWP, macOS">, we could consider cleaning these up in a future PR.