GTK application don't run in windows - c#

I develop a little test to study C# and GTK. In linux, this works perfectly, but when I try to run this in windows never works. The project is a simple calc.
In these windows I install:
dotNetx45_Full
gtk2runtime-2.24.10-2012-10-10
gtk-sharp-2.12.45
At this moment when I run in windows the feedback in windows events is:
Application: Calculadora.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Information: System.DllNotFoundException
Stack:
in GLib.Object.gtksharp_register_type (IntPtr, IntPtr)
in GLib.Object.RegisterGType (System.Type)
in GLib.Object.LookupGType (System.Type)
in GLib.Object.LookupGType ()
in GLib.Object.CreateNativeObject (IntPtr [], GLib.Value [], Int32)
in Gtk.Window..ctor (Gtk.WindowType)
in Calculator.MainClass.Main (System.String [])
Thanks for all help!

That is odd. Gtk# says it targets gnome 2.20. It may be that you have some conflict between the versions in Gtk# and those in the Gtk2 runtime which look newer (2.24). I believe you should not need this runtime as the Gtk# installer should come with a runtime. It looks like the version of glib being loaded at runtime knows nothing about IntPtr. Could you have downloaded the mono version of gtk# rather than the .Net version? Try https://dl.xamarin.com/GTKforWindows/Windows/gtk-sharp-2.12.45.msi

Related

System.DllNotFoundException: msmpi.dll not found on OS X

I wanted to run an example using C# and MPI.NET (https://github.com/mpidotnet/MPI.NET).
I found some sources on StackOverflow that I should install open-mpi via homebrew. I did this.
I also have Mono installed, and after building the project with msbuild, I try to run Hello.exe with the following command:
mpiexec -np 2 mono Hello.exe
I get the exception System.DllNotFoundException: msmpi.dll assembly, which is straightforward. The problem is I don't know where to find this DLL, or whether some other mistake might be causing it.

Winforms CL20R3 with CefSharp Project

I have a similar problem to this question C# windows appication Event: CLR20r3 on application start
The error is like this:
Application: MantenedorPlanesMain.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
Battery:
in CefSharp.Example.CefExample.Init ()
in CefSharp.WinForms.Example.Program.Main ()
But only on some machines, for example, on my computer I can use the program without any problem and in a computer of my office too.
I tried to find the source of the problem here in stackoverflow and realized that the error was caused by a cs file not found, but is within the project.
When I go to see CefSharp.WinForms.Example.Program.cs and comment the line of CefSharp.Example.CefExample.Init() throws me the same error in another file.
I tried everything, even the CopyLocal = true and x86, but still not working. I think there may be a problem with the system language, which is the only common factor of the machines that worked, Spanish language system.
any ideas?
In this context FileNotFoundException usually means you need to install VC++ or that you compiled in Debug mode (You need to build in Release mode when running on a machine without VS installed)
https://github.com/cefsharp/CefSharp/blob/master/NuGet/Readme.txt#L18
Also See the Note within https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions#6-how-do-i-include-the-visual-studio-c-2012-redistributables-on-the-target-app

SharpDX Not Implemented Exception

What could be the reason I am getting a SharpDX NotImplemented Exception?
SharpDX.SharpDXException: HRESULT: [0x80004001], Module: [General], ApiCode: [E_NOTIMPL/Not implemented], Message: Not implemented
at SharpDX.Result.CheckError()
at SharpDX.MediaFoundation.MediaFactory.Startup(Int32 version, Int32 dwFlags)
at SharpDX.MediaFoundation.MediaManager.Startup(Boolean useLightVersion)
this is on windows 8 desktop. the same code runs fine on windows 7.
Looking at native call for MFStartup
Seems it can happen when media components are not installed.
Here is a link with media feature pack download, hopefully should sort your problem (no idea why this is not here by default).

Mono on ARM linux

i've crosscompile Mono for embedded linux on ARM9 processor.
But when i try to compile my first c# program "Hello world" i receive this
output from Mono:
Native stacktrace:
Debug info from gdb:
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Aborted
I've googled but my problem is too generic.
Can someone explain the problem ?
Can i crosscompile the example file on pc (with Mono-arm compiler) end run
the binary on embedded-arm ?
i'll try to recompile without Mono-debugger.
Thanks

GTK# + WebKit + Windows

I have developed a GTK# application that makes use of webkit-sharp to edit email templates. This application works in Linux but when it is run in Windows it does not work. I am using the webkit-sharp.dll from Linux in Windows. The error that I am getting is:
System.TypeInitializationException: The type initializer for 'WebKit.WebView' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'webkit-1.0': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at WebKit.Download.webkit_download_get_type()
at GtkSharp.WebkitSharp.ObjectManager.Initialize()
at WebKit.WebView..cctor()
--- End of inner exception stack trace ---
at WebKit.WebView..ctor()
at MainWindow..ctor()
I am guessing that webkit-sharp.dll only wraps the native libraries for WebKit. I do not know where to get "webkit-1.0". Is there a webkit-sharp.dll that is specific to Windows for GTK#?
I did exactly that. I guess the webkit windows dll does not use gtk as rendering engine.
What I did was install the libwebkit dll provided by the suse mingw32 port and all of its dependencies.
You can see a full list of dependencies here
At the time of doing it(1 year ago more or less) the rendering was not perfect, but it may have improved.
I'm also having this problem...
Not tried this, but at http://www.webkit.org/building/checkout.html
The site suggests:
Download webkit support libraries
Run the update-webkit script
Build webkit from source
I think this requires cygwin installed.
I'm just paraphrasing the site - not tried this yet.
Have you tried running the Hello World example app to make sure everything is set up correctly in your Windows environment?
http://mono-project.com/Mono_Basics
You can also try some of the other example programs to make sure they function without error.
http://www.mono-project.com/GtkSharpBeginnersGuide
Seems like a common installation issue requires the addition of an environment variable in windows to get the assemblies loaded correctly:
http://www.mono-project.com/FAQ:_General#Installation_Problems

Categories