does razor pages support aot?

mc 5,431 Reputation points
2024-04-17T15:36:34.7966667+00:00

razor pages support AOT?

Developer technologies | ASP.NET | ASP.NET Core
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 77,851 Reputation points Volunteer Moderator
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.