-
-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NAOT compatibility #572
Comments
Hello @euju-ms , Thank you for reporting. Do you think you could provide a PR? I will be happy to look at it. I never did any AOT library, so you surely have more knowledge than me about what else should be modified. Best Regards, Jon |
I can create the PR, but how do you want to deal with the old API? I think the right way to move forward is to remove the support for Keeping the old API is fine as far as AOT goes because the warning will only appear when the old API is in use. As far as other AOT issues go, I'm not totally sure how many exists. I thought I could just set From a quick look, here are some other methods that are not AOT compatible:
All these warnings came up when I published an app that calls into Though, I want to focus on GetAttributeValue for the time being as this is mainly the problem I'm hitting :P. By the way, if I were using HtmlAgilityPackage directly, I can actually avoid the issue by avoiding |
Here's the PR: #573 |
Hello @euju-ms , The PR has been merged and released in v1.11.71 The only thing I removed is the I don't feel the method should be obsolete and is only a problem for people using Let me know if everything work as expected And thank you for the PR ;) Best Regards, Jon |
@JonathanMagnan |
Here is what to include in your request to make sure we implement a solution as quickly as possible.
1. Description
Native AOT incompatibility with
Utilities.To
When publishing an App with AOT enabled, following warnings appear indicating the AOT incompatibility:
This can be easily fixed by making
GetAttributeValue
method generic and only do the conversion when a custom converter is provided. However, this does change the behavior of the original GetAttributeValue method so it's probably better to just modify the internal usages of theUtilities.To
to use explicit converters and keep the original API the same in terms of behavior.E.g.
Method in
HtmlNode
:Note that I can actually work around the AOT issues by not using the provided
HtmlNode.GetAttributeValue
method and using my own implementation sinceHtmlNode.Attributes
andHtmlAttribute.Value
are public.2. Exception
Not applicable
3. Fiddle or Project
App must be published with AOT enabled for the warning to appear.
E.g.
And the code that triggers the warning will look like this:
4. Any further technical details
Native AOT
The text was updated successfully, but these errors were encountered: