使用.Net运行MonoDev中制作的gtk#应用程序 [英] Running an gtk# Application made in MonoDev with .Net

查看:87
本文介绍了使用.Net运行MonoDev中制作的gtk#应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,我正在尝试学习如何使用gtk#和Xamarin Studio,但是在创建.EXE之后,我无法在.NET中运行它.我真的是C#的新手,我不知道我的程序需要在.Net中工作什么,它在mono中可以正常运行,但是我想看看它是否可以在没有mono的情况下工作.

Right now I am trying to learn how to use gtk# and Xamarin studio , but after I create the .EXE I cant run it with .NET. I am really new to C# and I have no idea what my program needs to work in .Net , It runs fine in mono but I would just like to see if It could work without mono .

当我尝试从cmd运行Exe时,我得到了

When I try to run the Exe from cmd I get this

Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'libgtk-win
32-2.0-0.dll': The specified procedure could not be found. (Exception from HRESU
LT: 0x8007007F)
   at Gtk.Application.gtk_init(Int32& argc, IntPtr& argv)
   at Gtk.Application.Init()
   at Notepad.Notepad.Main(String[] args)

我试图创建的程序只是gtk#中制作的记事本的一个副本.

The program I was trying to create is just a clone of notepad made in gtk# .

推荐答案

如果您在与用于开发的机器不同的机器上运行GTK#应用程序,则需要安装以下依赖项才能满足您的要求.应用程序完美运行:

If you are running the GTK# app on a different machine than the one you used to develop, then you need to have the following dependencies installed in order for your app to run perfectly:

  1. 您要定位的版本的.NET Framework运行时(无论是mono还是ms,都可以)

  1. The .NET Framework Runtime for the version you are targetting (either mono or ms, both are fine)

GTK#框架(您可以在此处找到它: http://download.xamarin.com/Installer/gtk-sharp-2.12.20.msi )

The GTK# Framework (You can find it here: http://download.xamarin.com/Installer/gtk-sharp-2.12.20.msi)

GTK +库:GTK#是对GTK +的绑定,而不是它的完整端口.因此,您还需要来自 http://www.gtk.org/download/win32.php的GTK +库

GTK+ Libraries: GTK# is a binding to GTK+ and not a full port of it. So you also need the GTK+ libraries from http://www.gtk.org/download/win32.php

注意:

对于第2点,您可以选择将gtk#msi作为安装软件包的一部分. 如果是3,则可以下载完整的gtk +捆绑包(由glade和其他第三方库组成),也可以仅下载gtk,gdk,pango等的单个运行时dll,以进行简约安装.

In case of point 2, you can optionally include the gtk# msi as part of your installation package. In case of 3, you can either download the full gtk+ bundle (consisting of glade and other 3rd party libraries) or just the individual runtime dlls for gtk, gdk, pango, etc for a minimalist installation.

这篇关于使用.Net运行MonoDev中制作的gtk#应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆