-
Hi, I am trying to make my libraries compatible with AOT.
I have done #1, #2, #4 and #5. and I don't have any warnings about AOT/Trim. But I have codes that I have used Therefore, the question is:
I will tag the people who may be able to help, I apologize in advance |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@ghost1372 The general answer is that if your code compiles warning free, it should execute error free. If the type is known statically at compile time (as it would be with FooType.GetType(), but not necessarily with fooInstance.GetType()), then the code is AOT/Trim safe. As for LibraryImport, the compile may not be warning for DllImport. @manodasanW, do you remember warnings in gallery that required use LibraryImport? See also: |
Beta Was this translation helpful? Give feedback.
-
就我个人而言,如果您在编译过程中没有发现 Visual Studio 给出任何有关裁剪和 AOT 编译时的警告,我个人认为该库就与 AOT 兼容。
(2)在调试中需要将调试方法从混合(托管和本机)切换为本机 确保做到上述两点,您可以就做到您的应用程序与 AOT 兼容。 Personally, if you don't see any warnings from Visual Studio about clipping and AOT compilation during the compilation process, I personally think the library is AOT compatible.
(2) In debugging, you need to switch the debugging method from hybrid (managed and native) to native Make sure you do both of the above so that your application is AOT compatible. |
Beta Was this translation helpful? Give feedback.
@ghost1372 The general answer is that if your code compiles warning free, it should execute error free. If the type is known statically at compile time (as it would be with FooType.GetType(), but not necessarily with fooInstance.GetType()), then the code is AOT/Trim safe. As for LibraryImport, the compile may not be warning for DllImport. @manodasanW, do you remember warnings in gallery that required use LibraryImport?
See also:
https://devblogs.microsoft.com/dotnet/creating-aot-compatible-libraries/