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

Eto.Platform.Gtk + newer version of Gtk: failure #1761

Closed
mennodeij opened this issue Aug 4, 2020 · 4 comments
Closed

Eto.Platform.Gtk + newer version of Gtk: failure #1761

mennodeij opened this issue Aug 4, 2020 · 4 comments

Comments

@mennodeij
Copy link

I'm working on making a Gtk3 based handler for gtksourceview using the recently published GtkSourceSharp .

The latest Eto.Platform.Gtk has a dependency on GtkSharp >= 3.22.25.74
GtkSourceSharp has a depencency on GtkSharp >= 3.22.25.118

So I have two projects: the "neutral" EtoSourceView and the "gtk-specific" EtoSourceView.Gtk (see also attached
EtoSourceView.zip )

Unfortunately, the EtoSourceView.Gtk does not build, because it references GtkSharp 3.22.25.118. The error message is:

The type 'Gtk.ScrolledWindow' cannot be used as type parameter 'TControl' in the generic type or method 'GtkControl<TControl, TWidget, TCallback>'. There is no implicit reference conversion from 'Gtk.ScrolledWindow' to 'Gtk.Widget'. EtoSourceView.Gtk D:\zandbak\EtoSourceView\EtoSourceView.Gtk\XmlTextAreaHandler.cs

The type 'Widget' is defined in an assembly that is not referenced. You must add a reference to assembly 'GtkSharp, Version=3.22.25.74, Culture=neutral, PublicKeyToken=null'. EtoSourceView.Gtk D:\zandbak\EtoSourceView\EtoSourceView.Gtk\XmlTextAreaHandler.

I am at a loss how to solve this. I have tried to use the older GtkSharp, but then I get other errors. Also I have tried to use an app.config file with assembly redirect, but that also did not work.

Any hints on how to proceed are much appreciated!

@cwensley
Copy link
Member

cwensley commented Aug 6, 2020

@mennodeij, this appears to be because GtkSharp 3.22.25.118 is strong named, whereas the older version is not. This is a breaking change for any binaries using the older GtkSharp, and they must be recompiled.

So, the only option is to wait for Eto to switch to the strong named version. Or, you might be able to use the AppDomain.CurrentDomain.AssemblyResolve event to load the (newer) version. Assuming there were no other ABI breaking changes.

@mennodeij
Copy link
Author

Ah, that is what it is. Well I'm glad that you found that out. I'll see what I can do to get it working now that I have a lead on where to start. Thanks 🙂

@harry-cpp
Copy link
Contributor

Hmm, I'm just gonna revert strong naming, not worth breaking changes like these.

@mennodeij
Copy link
Author

Thanks, that is very helpful!

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

No branches or pull requests

3 participants