Closed lozn00 closed 2 years ago
This exception is caused by using new SDK with old builds of native aot.
The best way to solve this problem is to use .NET 7 SDK RC1 or newer, set PublishAot property in the project file to true, and let the SDK download the matching version of the aot package for you. It is no longer necessary to manually reference the aot package with .NET 7 SDKs.
thank you , May I ask whether the latest version of.NET will solve some problems better?
@jkotas I'm now back down to.net6 and use 7.0.0-alpha.1.21423.2 <PackageReference Include="Microsoft.DotNet.ILCompiler;" Version="7.0.0-alpha.1.21423.2" />
Yes, .NET 7 solves this problem. Check out the documentation we have for .NET 7: https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/ . It just tells you to set the PublishAot property and that's it. You do not need it worry about having the right package versions at all.
rd.xml does not define JSON-related content, how to write content to ignore this problem? web core api