Skip to content
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

Method not found: 'Int32 HtmlAgilityPack.HtmlNode.GetAttributeValue (binary breaking change) #375

Closed
ronaldbarendse opened this issue Feb 21, 2020 · 4 comments
Assignees

Comments

@ronaldbarendse
Copy link

Description

After upgrading from 1.11.18 to 1.11.19 (or 1.11.20) the following exception is thrown, because this method is removed for some targets:

#if METRO || NETSTANDARD1_3 || NETSTANDARD1_6
/// <summary>
/// Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned.
/// </summary>
/// <param name="name">The name of the attribute to get. May not be <c>null</c>.</param>
/// <param name="def">The default value to return if not found.</param>
/// <returns>The value of the attribute if found, the default value if not found.</returns>
public int GetAttributeValue(string name, int def)
{

This is a binary breaking change, as libraries using this method will need to be recompiled against this version to work again.

Exception

Exception message: Method not found: 'Int32 HtmlAgilityPack.HtmlNode.GetAttributeValue(System.String, Int32)'.
Stack trace: System.MissingMethodException

Further technical details

  • NET version (net472, netcore, etc.): net472
@JonathanMagnan JonathanMagnan self-assigned this Feb 21, 2020
@JonathanMagnan
Copy link
Member

Hello @ronaldbarendse ,

Yes, you are right.

I will ask my developer to restore those methods and explain to him why he never removes one unless we release a major.

Best Regards,

Jon


Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework ExtensionsEntity Framework ClassicBulk OperationsDapper Plus

Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval FunctionSQL Eval Function

@ronaldbarendse
Copy link
Author

These kind of breaking changes are always hard to track, as you would expect it to automatically use the generic method in this case... 😉 And it does without changing the consuming libraries code, but it still requires a recompile, because the binary/IL code will be different.

Adding the methods back for these targets as stubs that call the generic version should be an easy fix 👍 The next major version could then remove these methods again.

@JonathanMagnan
Copy link
Member

Yup exactly ;)

The v1.11.21 is now released.

Let me know if your project is now working correctly

@ronaldbarendse
Copy link
Author

Thanks, this patch has fixed the issue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants