-
Notifications
You must be signed in to change notification settings - Fork 561
Open
Labels
Area: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.enhancementProposed change to current functionality.Proposed change to current functionality.
Milestone
Description
Android framework version
net9.0-android
Affected platform version
any
Description
Context: #9525
Context: dotnet/runtime#109724
As seen in the above issue, there is currently the expectation in .NET:
PublishTrimmed=trueset for all configurations, it means "I intend to trim this project"- Not all builds need to actually run
illink. For console apps,dotnet builddoesn't trim orillink,dotnet publishdoes trim and runillink. - .NET SDK sets various feature switches based on
PublishTrimmed
Unfortunately, Android doesn't follow this pattern:
- Debug mode,
PublishTrimmed=falsefor build performance, inner loop - Release mode,
PublishTrimmed=true
To fix this in .NET 10, we should:
- Set
PublishTrimmed=truealways - Disable
illinkin Debug mode via other means
Steps to Reproduce
dotnet new androiddotnet build(debug mode)- Observe RuntimeInstanceNotAllowed Error Initializing XmlSerializer on Android Release Build in .NET 9 runtime#109724
Did you find any workaround?
For the case above you could set $(_DefaultValueAttributeSupport) as done in #9525.
sbomer
Metadata
Metadata
Assignees
Labels
Area: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.enhancementProposed change to current functionality.Proposed change to current functionality.