-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
AppHost should be disabled by default for macOS like it is for iOS / tvOS / Mac Catalyst / Android #53307
Comments
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue DetailsDescriptionXamarin.Mac for .NET (the I'm not sure what's the best way to do it though, since the applicable RIDs ( CC @akoeplinger
|
We're actually planning on enabling the apphost for Mac due to the x64/ARM64 split on Apple Si. What's the reason why mobile platforms need to have the apphost disabled? |
We don't use it, we host the runtime (either Mono or CoreCLR) ourselves. |
Hm as a workaround you can set |
Yeah, I'm not sure that's bad as an actual solution -- it seems like we just need to decide on the correct properties to set in the Xamarin targets. |
That can only be set in the csproj, because You can see the Import order here: https://gist.github.com/rolfbjarne/848f5c5fed4f3e1a5314232d269bb670 AutoImports.props is loaded at line 27: https://gist.github.com/rolfbjarne/848f5c5fed4f3e1a5314232d269bb670#file-gistfile1-txt-L27 - this is the first time our code is loaded, and at this point we can't set properties (https:/xamarin/xamarin-macios/blob/85ce924296eb17b4a3860b32cc94d8b4c1bfae00/dotnet/targets/Microsoft.Sdk.DefaultItems.template.props#L5-L16) Microsoft.NET.RuntimeIdentifierInference.targets is loaded at line 52: https://gist.github.com/rolfbjarne/848f5c5fed4f3e1a5314232d269bb670#file-gistfile1-txt-L52 Our WorkloadManifest.targets is loaded at line 65: https://gist.github.com/rolfbjarne/848f5c5fed4f3e1a5314232d269bb670#file-gistfile1-txt-L65 - this is where we can set properties, but it's too late. |
As we're enabling the AppHost for Mac we may be removing some usages of those properties, so I would be careful about dependencies here. Clearly |
@akoeplinger what do you think the best solution is? |
I think this should be solved in the SDK specific to Xamarin.Mac - I assume there's such a thing as the core SDK will not produce apps for it. Should we maybe move the issue to the repo which track the work on that SDK? |
With dotnet/sdk#18639 the RuntimeIdentifierInference.targets is now imported after the workload targets so setting Ideally we shouldn't need to rely on a "private" msbuild property though, an explicit We only need the @agocke sounds like if you touch this code anyway, can we just relax that check? |
I think the right approach for now is to use It seems better to make |
Description
Xamarin.Mac for .NET (the
net6.0-macos
target framework) are like mobile platforms in that the app host should be disabled by default here:https:/dotnet/sdk/blob/c53c8ac81e1bcb8118c31bc4f5622396c72e9959/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets#L118-L119
I'm not sure what's the best way to do it though, since the applicable RIDs (
osx-x64
/osx-arm64
) are also used for other target frameworks where the app host shouldn't get the same behavior.CC @akoeplinger
The text was updated successfully, but these errors were encountered: