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

Unsupported IBinding implementation after migration on 11.1 #16623

Closed
ds1709 opened this issue Aug 8, 2024 · 8 comments
Closed

Unsupported IBinding implementation after migration on 11.1 #16623

ds1709 opened this issue Aug 8, 2024 · 8 comments
Labels

Comments

@ds1709
Copy link
Contributor

ds1709 commented Aug 8, 2024

Describe the bug

I have custom IBinding implementation, based on math expressions. After migrating from versio 11.0 to 11.1 I got Unsupported IBinding implementation exception becaus my MathExpressionBinding doesn't implement IBinding2 interface. How can I implement it if it's internal, how can I implement any custom IBinding? Also I can't inherits from BindingBase because I cant implement it's private protected members. Version 11.1 is backward incompatible with 11.0, it breaks binary compatibility, it breaks behavior compatibility, it breaks sematic versioning principles. It must be 12.0, but not 11.1. It's fully incompatible with 11.0.

To Reproduce

Just try to implement IBinding2 interface.

Expected behavior

No response

Avalonia version

11.1.2

OS

No response

Additional context

No response

@ds1709 ds1709 added the bug label Aug 8, 2024
@kekekeks
Copy link
Member

kekekeks commented Aug 8, 2024

How exactly did you manage to implement an interface marked with [NotClientImplementable]? We are injecting special non-implementable methods to our ref assemblies to prevent that

@ds1709
Copy link
Contributor Author

ds1709 commented Aug 8, 2024

Interface IBinding is not NotClientImplementable, it works in version 11.0.*. But it throws exception in version 11.1.*. It's backward compatibility violation, and it must be major version update, not minor.

@grokys
Copy link
Member

grokys commented Aug 8, 2024

@grokys
Copy link
Member

grokys commented Aug 8, 2024

See also: #15270

@kekekeks
Copy link
Member

kekekeks commented Aug 8, 2024

It's marked as such at least since 11.0.0-preview1. I think our injected method no longer prevents Roslyn from building the assembly.

@ds1709
Copy link
Contributor Author

ds1709 commented Aug 8, 2024

Seems like we're talking about different things...
https://semver.org

If you have a huge audience that will be drastically impacted by changing the behavior back to what the public API intended, then it may be best to perform a major version release, even though the fix could strictly be considered a patch release.

It doesn't matter mark you it like NotClientImplementable, you are changing behavior compatibility, it MUST be major update, version 12.0.
Also, in version 11.0.11 I implemented my own MathExpressionBinding : IBinding and it works fine.

@kekekeks
Copy link
Member

kekekeks commented Aug 8, 2024

Those interfaces aren't supposed to be implementable from user code. We've had measures to prevent those from being implemented, but those aren't working with the new SDK since roslyn now ignores internal interface members in our ref assemblies.

IBinding not working when implemented by user code is expected.

@kekekeks kekekeks closed this as completed Aug 8, 2024
@ds1709
Copy link
Contributor Author

ds1709 commented Aug 8, 2024

IBinding not working when implemented by user code is expected.

My own binding works as expected, and implementing my own binding was the best solution in my case.

If you want to prevent user code from implementing interface, just make it internal (like IBinding2), or mark it with ObsoleteAttribute. Yes, making public interface internal breaks API and ABI compatibility, but breaking behavior is the worst of all.

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

No branches or pull requests

3 participants