dotnet / dotnet/android

Inconsistent defaulted feature switches

Open
#10,422 5 comments 0 reactions 0 assignees View on GitHub
Area: App+Library Build
Dominant language
C#
Stars
2.1k
Forks
579
Avg merge
1d 20h
Merged PRs (30d)
257

Description

### Android framework version

net10.0-android (Preview)

### Affected platform version

.NET 10

### Description

We set default feature switches like so:

https://github.com/dotnet/android/blob/b3a818771d7f33e76a278fdf16dbeb6e01ef8e00/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets#L125-L144

But in the dotnet/macios repo, a different set of feature switches is defaulted:

https://github.com/dotnet/macios/blob/477bd2df7713a87406ce5adfcfdae813bc677059/dotnet/targets/Xamarin.Shared.Sdk.targets#L112-L139

Below is a comparison table of these feature switches. We should aim to unify the defaulted feature switches (not the default values necessarily).

Feature Switch | Android | iOS | Notes
-- | -- | -- | --
BuiltInComInteropSupport | false | false |
_ComObjectDescriptorSupport | | false |
CustomResourceTypesSupport | | false |
_DefaultValueAttributeSupport | true if '$(TrimMode)' == 'partial' | |
DynamicCodeSupport | | false if '$(MtouchInterpreter)' == '' And '$(UseInterpreter)' != 'true' ) And ('$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'MacCatalyst'
_EnableConsumingManagedCodeFromNativeHosting | | false |
EnableCppCLIHostActivation | | false |
EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization | | false |
EnableUnsafeBinaryFormatterSerialization | false | false |
EnableUnsafeUTF7Encoding | false | false |
EnableSingleFileAnalyzer | true | |
EnableTrimAnalyzer | true if '$(TrimMode)' == 'full' | |
EventSourceSupport | | false if '$(Optimize)' == 'true' And '$(EnableDiagnostics)' != 'true' |
Http3Support | false | false |
HttpActivityPropagationSupport | | false if '$(Optimize)' == 'true' |
HybridGlobalization | | true if $(InvariantGlobalization)' != 'true' |
InvariantGlobalization | false | false |
JsonSerializerIsReflectionEnabledByDefault | true if '$(TrimMode)' == 'partial' | |
MetricsSupport | | false if '$(Optimize)' == 'true' And '$(EnableDiagnostics)' != 'true' |
NullabilityInfoContextSupport | | false |
StartupHookSupport | false | false |
UseNativeHttpHandler | `false` if $(AndroidHttpClientHandlerType.Contains ('System.Net.Http.SocketsHttpHandler')); `true` otherwise | `false` if '$(MtouchHttpClientHandler)' == 'HttpClientHandler'; `true` if '$(_PlatformName)' != 'macOS' |
UseSizeOptimizedLinq | true | true |
UseSystemResourceKeys | true if '$(PublishTrimmed)' == 'true' | `true` if '$(_BundlerDebug)' != 'true'; `false` if '$(_BundlerDebug)' == 'true' |
VerifyDependencyInjectionOpenGenericServiceTrimmability | `false` if '$(PublishTrimmed)' == 'true'; `true` otherwise | `false` if '$(_BundlerDebug)' != 'true'; `true` otherwise

### Steps to Reproduce

Observe the source files

### Did you find any workaround?

_No response_

### Relevant log output

```shell

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.