How to run default gtk project on Ubuntu with dotnet command.

Skip to first unread message

Jason Holt

Oct 29, 2020, 5:15:25 PM10/29/20
to Eto.Forms

I did the following:


Created solution EtoApp1 Using the ETO Visual Studio 2019 extension template.

Upgraded the Nuget packages to 2.56.

Changed the <TargetFrameworks> tags in the EtoApp1 and EtoApp1.Gtk project files to the singular so the gtk project would publish.

Successfully built both projects and published EtoApp1.Gtk to a folder on my Windows PC.

The folder contains lots of dlls, including Eto.Gtk.dll.

Copied the contents of the publish folder to my home directory in Ubuntu Mate.

Installed the dotnet core sdk from snap on my Ubuntu Mate box.

In a Mate terminal, typed


$dotnet EtoApp1.Gtk.dll


And encountered the following error:


Unhandled exception. System.TypeInitializationException: The type initializer for 'Gtk.Application' threw an exception.

 ---> System.DllNotFoundException: Gtk: libgtk-3-0.dll,, libgtk-3.0.dylib, gtk-3.dll

   at GLibrary.Load(Library library)

   at Gtk.Application..cctor()




Installed mono-complete and typed mono EtoApp1.Gtk.dll and the program worked as expected.

Retried with the dotnet command but got the original error.



Must I run Eto apps from mono? The release notes for 2.50 say dotnet core is supported.

If not, what am I doing wrong?

Thanks for your help,




Jason Holt

Oct 30, 2020, 1:26:04 PM10/30/20
I failed to mention that I'm running Ubuntu Mate 20.04 and the dotnet core version is 3.1.9 via snap.

You received this message because you are subscribed to a topic in the Google Groups "Eto.Forms" group.
To unsubscribe from this topic, visit
To unsubscribe from this group and all its topics, send an email to
To view this discussion on the web visit


Oct 30, 2020, 2:31:51 PM10/30/20
to Eto.Forms

It is probably a path issue, or something to do with using snap.  From what I recall, snap runs everything inside its own sandbox environment, so the dotnet snap environment probably doesn't have access to Gtk+ libraries.

Hope this helps.

Jason Holt

Oct 30, 2020, 4:10:24 PM10/30/20
You are correct; removing the snap version and installing from apt fixed the problem. Funny, I thought of that but was too darn lazy to try.

By the way, I am blind and am happy to find that the default program is accessible to the Ubuntu screen reader. I am very much a novice, but the notion that I may be able to create accessible applications is intriguing. I will need to test with more complex controls.

I hope that your future plans for ETO won't break screen reader compatibility.



Reply all
Reply to author
0 new messages