-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[xaml] fix x:Array and x:Double in Release mode #14546
Merged
jonathanpeppers
merged 1 commit into
dotnet:main
from
jonathanpeppers:xArray-and-xDouble
Apr 17, 2023
Merged
[xaml] fix x:Array and x:Double in Release mode #14546
jonathanpeppers
merged 1 commit into
dotnet:main
from
jonathanpeppers:xArray-and-xDouble
Apr 17, 2023
Conversation
This file contains 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
Fixes: dotnet#9422 Context: https://github.com/dotnet/maui/blob/51df629f946122945cee8f57baed80eb48e45c4e/src/Controls/src/Core/Properties/AssemblyInfo.cs#L79 In `Microsoft.Maui.Core.dll`, the default `x` namespace is defined as: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] The problem being that in apps on iOS and Android where `PublishTrimmed` is `true`, `mscorlib.dll` will get trimmed away and callsites will use `System.Private.CoreLib.dll` instead. This is very much related to the issue fixed in 880ce09. Unfortunately, my fix wasn't sufficient, because the `AssemblyName` name in this case is the full name: AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" To solve the issue, let's also check for `StartsWith("mscorlib,")`. We *could* add a new `XmlnsDefinition`, but this doesn't feel right: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] It doesn't make sense for a "private" assembly to appear in XAML intellisense. I also moved these tests to a new `XamlTests` class, as it didn't really make sense to put them with `RadioButton` tests. Note that these new tests wouldn't fail until we start running device tests in `Release` mode: dotnet#14392
If this is backported, you would also need:
Recommended full set |
StephaneDelcroix
approved these changes
Apr 17, 2023
This was referenced Apr 17, 2023
hartez
added a commit
that referenced
this pull request
Jun 5, 2023
Fixes: #9422 Context: https://github.com/dotnet/maui/blob/51df629f946122945cee8f57baed80eb48e45c4e/src/Controls/src/Core/Properties/AssemblyInfo.cs#L79 In `Microsoft.Maui.Core.dll`, the default `x` namespace is defined as: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] The problem being that in apps on iOS and Android where `PublishTrimmed` is `true`, `mscorlib.dll` will get trimmed away and callsites will use `System.Private.CoreLib.dll` instead. This is very much related to the issue fixed in 880ce09. Unfortunately, my fix wasn't sufficient, because the `AssemblyName` name in this case is the full name: AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" To solve the issue, let's also check for `StartsWith("mscorlib,")`. We *could* add a new `XmlnsDefinition`, but this doesn't feel right: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] It doesn't make sense for a "private" assembly to appear in XAML intellisense. I also moved these tests to a new `XamlTests` class, as it didn't really make sense to put them with `RadioButton` tests. Note that these new tests wouldn't fail until we start running device tests in `Release` mode: #14392
rmarinho
pushed a commit
that referenced
this pull request
Jun 6, 2023
Fixes: #9422 Context: https://github.com/dotnet/maui/blob/51df629f946122945cee8f57baed80eb48e45c4e/src/Controls/src/Core/Properties/AssemblyInfo.cs#L79 In `Microsoft.Maui.Core.dll`, the default `x` namespace is defined as: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] The problem being that in apps on iOS and Android where `PublishTrimmed` is `true`, `mscorlib.dll` will get trimmed away and callsites will use `System.Private.CoreLib.dll` instead. This is very much related to the issue fixed in 880ce09. Unfortunately, my fix wasn't sufficient, because the `AssemblyName` name in this case is the full name: AssemblyName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" To solve the issue, let's also check for `StartsWith("mscorlib,")`. We *could* add a new `XmlnsDefinition`, but this doesn't feel right: [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2009/xaml", "System", AssemblyName = "System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] It doesn't make sense for a "private" assembly to appear in XAML intellisense. I also moved these tests to a new `XamlTests` class, as it didn't really make sense to put them with `RadioButton` tests. Note that these new tests wouldn't fail until we start running device tests in `Release` mode: #14392
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-xaml
XAML, CSS, Triggers, Behaviors
backport/approved
After some discussion or review, this PR or change was approved to be backported.
backport/suggested
The PR author or issue review has suggested that the change should be backported.
fixed-in-8.0.0-preview.4.8333
Look for this fix in 8.0.0-preview.4.8333!
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.
Fixes #9422
In
Microsoft.Maui.Core.dll
, the defaultx
namespace is defined as:maui/src/Controls/src/Core/Properties/AssemblyInfo.cs
Line 79 in 51df629
The problem being that in apps on iOS and Android where
PublishTrimmed
istrue
,mscorlib.dll
will get trimmed away and callsites will useSystem.Private.CoreLib.dll
instead.This is very much related to the issue fixed in 880ce09.
Unfortunately, my fix wasn't sufficient, because the
AssemblyName
name in this case is the full name:To solve the issue, let's also check for
StartsWith("mscorlib,")
.We could add a new
XmlnsDefinition
, but this doesn't feel right:It doesn't make sense for a "private" assembly to appear in XAML intellisense.
I also moved these tests to a new
XamlTests
class, as it didn't really make sense to put them withRadioButton
tests.Note that these new tests wouldn't fail until we start running device tests in
Release
mode: #14392