-
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
Possible to detect AOT mode during runtime? #76739
Comments
Is |
Benchmark.NET uses this trick to detect which runtime it's running on https://github.com/dotnet/BenchmarkDotNet/blob/1f5637c784ad9887a2d5abdba54d1337655281b1/src/BenchmarkDotNet/Portability/RuntimeInformation.cs#L44-L47 |
The BenchmarkDotNet trick is incorrect because PublishSingleFile also produces |
After multiple tests, this does not work (tried in .NET 6 & .NET 7) I tried the line below just before |
How about
|
Thanks a lot @hez2010, |
This can be helpful when doing A/B testing or when showing AOT version of the app only to desktop users.
For example, we are using Azure CDN to mask 2 versions of the same app,
mobile users get the normal Blazor & desktop users get the AOT version.
With the same domain name.
The obvious solution is to set a flag during the build process of the AOT version.
And this is the direction we are heading.
But is there another straightforward way?
The text was updated successfully, but these errors were encountered: