How to apply strong name for native AOT exe?

Siva Krishna Kodali 0 Reputation points
2024-08-21T13:10:26.11+00:00

By using .NET8 Native AOT implemented one exe. which is working fine. Now problem is unable to apply the Strong Name on top of the EXE. Is their any way to apply strong name to that

the existed Micosoft sign tool was not working to apply strong name on that one. Is microsoft is supporting to enable Strong name on top of Native AOT compiled solutions

Any help would be appreciate. Thanks

Developer technologies | .NET | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-08-22T07:04:45.77+00:00

    Hi @Siva Krishna Kodali , Welcome to Microsoft Q&A,

    The output of Native AOT compilation is a native executable, not a managed assembly, so the structure required for strong naming does not exist. You should consider using a code signing certificate to sign native executables instead of using strong naming. This approach is more consistent with native applications and provides similar benefits, such as integrity and authenticity guarantees.

    If your scenario specifically requires strong naming (for example, to meet certain compliance requirements in the managed .NET ecosystem), you may want to reconsider whether Native AOT is the right tool for the project. Otherwise, code signing is often an acceptable alternative for native executables.

    Microsoft does not support applying strong names to Native AOT compiled executables, but this is a limitation of the Native AOT toolchain.

    Best Regards,

    Jiale


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

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.