-
Notifications
You must be signed in to change notification settings - Fork 4.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
XmlCompiledTransform.Load throws a System.PlatformNotSupportedException on iOS with .NET 8 #96920
Comments
Tagging subscribers to this area: @dotnet/area-system-xml Issue DetailsDescriptionCalling Reproduction Steps
Expected behavior
Actual behaviorCalling
Regression?
Known WorkaroundsUsing the obsolete ConfigurationiOS
Xcode
Dotnet
Other informationThese are the build properties set for the debug iOS app that may be relevant. <SupportedOSPlatformVersion>15.0</SupportedOSPlatformVersion>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchInterpreter>all</MtouchInterpreter>
<MtouchProfiling>False</MtouchProfiling>
<MtouchFastDev>False</MtouchFastDev>
<MtouchUseRefCounting>True</MtouchUseRefCounting>
<MtouchOptimizePNGs>True</MtouchOptimizePNGs>
<MtouchI18n>cjk,rare,west</MtouchI18n>
<MtouchUseSGen>True</MtouchUseSGen>
<MtouchEnableBitcode>False</MtouchEnableBitcode>
<MtouchFloat32>False</MtouchFloat32>
<EnableSGenConc>True</EnableSGenConc>
<MtouchDebug>True</MtouchDebug>
<MtouchEnableGenericValueTypeSharing>False</MtouchEnableGenericValueTypeSharing>
<MtouchUseLlvm>False</MtouchUseLlvm>
<MtouchUseThumb>False</MtouchUseThumb>
<MtouchNoSymbolStrip>True</MtouchNoSymbolStrip>
<RuntimeIdentifiers>ios-arm64</RuntimeIdentifiers>
|
Tagging subscribers to 'os-ios': @steveisok, @akoeplinger, @kotlarmilos Issue DetailsDescriptionCalling Reproduction Steps
Expected behavior
Actual behaviorCalling
Regression?
Known WorkaroundsUsing the obsolete ConfigurationiOS
Xcode
Dotnet
Other informationThese are the build properties set for the debug iOS app that may be relevant. <SupportedOSPlatformVersion>15.0</SupportedOSPlatformVersion>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchInterpreter>all</MtouchInterpreter>
<MtouchProfiling>False</MtouchProfiling>
<MtouchFastDev>False</MtouchFastDev>
<MtouchUseRefCounting>True</MtouchUseRefCounting>
<MtouchOptimizePNGs>True</MtouchOptimizePNGs>
<MtouchI18n>cjk,rare,west</MtouchI18n>
<MtouchUseSGen>True</MtouchUseSGen>
<MtouchEnableBitcode>False</MtouchEnableBitcode>
<MtouchFloat32>False</MtouchFloat32>
<EnableSGenConc>True</EnableSGenConc>
<MtouchDebug>True</MtouchDebug>
<MtouchEnableGenericValueTypeSharing>False</MtouchEnableGenericValueTypeSharing>
<MtouchUseLlvm>False</MtouchUseLlvm>
<MtouchUseThumb>False</MtouchUseThumb>
<MtouchNoSymbolStrip>True</MtouchNoSymbolStrip>
<RuntimeIdentifiers>ios-arm64</RuntimeIdentifiers>
|
Can you please try UseInterpreter=true instead of MtouchInterpreter? Note that XslCompiledTransform requires dynamic code generation so it is fundamentally incompatible with the full AOT environment required by iOS. Enabling the interpreter works around that by interpreting all code but looks like MtouchInterpreter didn't cause it to get enabled correctly anymore. |
Thanks @akoeplinger for the suggestion. Setting Previously setting UseInterpreter = true was a synonym for MtouchInterpreter = all with iOS. I don't know if there was some sort of undocumented change or I missed something that this behavior changed with the .NET 8 SDK. So this may be instead a regression or undocumented change in the build settings instead of the XmlCompiledTransform class. |
@rolfbjarne are you aware of any MtouchInterpreter=all/UseInterpreter=true inconsistencies? |
Yes, we have a bug in this area, which should be fixed with xamarin/xamarin-macios#19812. |
The canonical property we use for the interpreter is `MtouchInterpreter` - and the interpreter is enabled if `MtouchInterpreter` is set to any value (the `MtouchInterpreter` value is used to select which assemblies to interpret, the only way to completely disable the interpreter is to not set `MtouchInterpreter` at all). So fix a couple of cases of wrong comparison: * Don't use `UseInterpreter` - which is used to compute a specific value for `MtouchInterpreter` - because developers don't have to set `UseInterpreter` to enable the interpreter, they can set `MtouchInterpreter` directly. * Don't compare `MtouchInterpreter` with `true`: that only checks if the assembly "true" is interpreted (which it rarely is). Fixes dotnet/runtime#96920.
The canonical property we use for the interpreter is `MtouchInterpreter` - and the interpreter is enabled if `MtouchInterpreter` is set to any value (the `MtouchInterpreter` value is used to select which assemblies to interpret, the only way to completely disable the interpreter is to not set `MtouchInterpreter` at all). So fix a couple of cases of wrong comparison: * Don't use `UseInterpreter` - which is used to compute a specific value for `MtouchInterpreter` - because developers don't have to set `UseInterpreter` to enable the interpreter, they can set `MtouchInterpreter` directly. * Don't compare `MtouchInterpreter` with `true`: that only checks if the assembly "true" is interpreted (which it rarely is). Fixes dotnet/runtime#96920.
… is enabled. (#20732) The canonical property we use for the interpreter is `MtouchInterpreter` - and the interpreter is enabled if `MtouchInterpreter` is set to any value (the `MtouchInterpreter` value is used to select which assemblies to interpret, the only way to completely disable the interpreter is to not set `MtouchInterpreter` at all). So fix a couple of cases of wrong comparison: * Don't use `UseInterpreter` - which is used to compute a specific value for `MtouchInterpreter` - because developers don't have to set `UseInterpreter` to enable the interpreter, they can set `MtouchInterpreter` directly. * Don't compare `MtouchInterpreter` with `true`: that only checks if the assembly "true" is interpreted (which it rarely is). Fixes dotnet/runtime#96920. This is a backport of #19812 and #20696.
Description
Calling
XmlCompiledTransform.Load(XmlReader, XsltSettings, XmlResolver)
in a .NET 8 iOS MAUI app throws a PlatformNotSupportedException. This call worked previously when targeting .NET 7 iOS MAUI. From the stacktrace it's likely that allXmlCompiledTransform.Load
methods will throw this exception.Reproduction Steps
XmlCompiledTransform.Load(XmlReader, XsltSettings, XmlResolver)
with a valid xsl file, xml resolver, andXsltSettings.EnableDocumentFunction = true
andXsltSettings.EnableScript = false
.Load
throws an exception.Expected behavior
XmlCompiledTransform.Load
loads the provided xsl transform.Actual behavior
Calling
XmlCompiledTransform.Load
throws an exception with the given stack trace.Regression?
XmlCompiledTransform.Load
worked previously with Xamarin.iOS as well as .NET 7 iOS MAUI. It stopped working with .NET 8 iOS MAUI.Known Workarounds
Using the obsolete
XmlTransform
class instead on iOS with .NET 8 works, but comes at the cost ofXmlTransform.Transform
having worse performance thanXmlCompiledTransform.Transform
.Configuration
iOS
Xcode
Dotnet
Other information
These are the build properties set for the debug iOS app that may be relevant.
The text was updated successfully, but these errors were encountered: