does razor pages support aot?

mc 3,681 Reputation points
2024-04-17T15:36:34.7966667+00:00

razor pages support AOT?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,177 questions
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 56,526 Reputation points
    2024-04-17T21:20:07+00:00

    no.

    for example, the System.Text.Json libraries only just got AOT support, and it requires the use of source generators only:

    https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/source-generation?pivots=dotnet-8-0

    other AOT restrictions that may cause issues:

    • no dynamic assembly loading
    • no runtime code generation (used by many libraries that use refection)
    • only AOT compliant libraries supported
    • reduced performance for Linq expressions
    • no com support
    • System.Configuration.ConfigurationManager not supported (use binding source generator)
    • Newtonsoft Json not supported
    • no C/C++ interop

    the benefits of an AOT razor page app is not clear. but if supported, you would be limited in the type of applications you could write. Also they would probably be slower than the non AOT version.


0 additional answers

Sort by: Most helpful