无法使用MS .NET运行时运行GTK#app,只能使用Mono运行

时间:2014-09-19 11:19:27

标签: c# .net dll mono gtk#

我使用Xamarin Studio 5.3(build 441)在Windows 7(64b)上编写GTK#(GTK 2.12)应用程序。

我已经安装了4.0和4.5 .Net SDK,而Xamarin使用.Net来编译"编译"我的应用程序(不是Mono,已安装[版本3.2.3])。

当我按下" Play" Xamarin Studio中的按钮正确编译我的应用程序并启动它。

如果在命令行中输入" mono LightCreator.exe",那么应用程序也可以顺利运行。

但是......这就是我遇到问题的地方:如果我尝试直接执行应用程序""从文件系统浏览器或键入"。\ LightCreator.exe"然后应用程序崩溃。

崩溃会生成三个日志文件,其中一个是二进制文件。以下是文本文件:

首先:

    <?xml version="1.0" encoding="UTF-16"?>
<WERReportMetadata>
    <OSVersionInformation>
        <WindowsNTVersion>6.1</WindowsNTVersion>
        <Build>7601 Service Pack 1</Build>
        <Product>(0x30): Windows 7 Professional</Product>
        <Edition>Professional</Edition>
        <BuildString>7601.18409.amd64fre.win7sp1_gdr.140303-2144</BuildString>
        <Revision>1130</Revision>
        <Flavor>Multiprocessor Free</Flavor>
        <Architecture>X64</Architecture>
        <LCID>3082</LCID>
    </OSVersionInformation>
    <ProblemSignatures>
        <EventType>CLR20r3</EventType>
        <Parameter0>lightcreator.exe</Parameter0>
        <Parameter1>0.1.5375.20160</Parameter1>
        <Parameter2>541c0170</Parameter2>
        <Parameter3>gtk-sharp</Parameter3>
        <Parameter4>2.12.0.0</Parameter4>
        <Parameter5>52cb5af9</Parameter5>
        <Parameter6>3c46</Parameter6>
        <Parameter7>16</Parameter7>
        <Parameter8>System.DllNotFoundException</Parameter8>
    </ProblemSignatures>
    <DynamicSignatures>
        <Parameter1>6.1.7601.2.1.0.256.48</Parameter1>
        <Parameter2>3082</Parameter2>
        <Parameter22>0a9e</Parameter22>
        <Parameter23>0a9e372d3b4ad19135b953a78882e789</Parameter23>
        <Parameter24>0a9e</Parameter24>
        <Parameter25>0a9e372d3b4ad19135b953a78882e789</Parameter25>
    </DynamicSignatures>
    <SystemInformation>
        [...]
    </SystemInformation>
</WERReportMetadata>

第二

<?xml version="1.0" encoding="UTF-16"?>
<DATABASE>
<EXE NAME="LightCreator.exe" FILTER="CMI_FILTER_PRIVACY">
    <MATCHING_FILE NAME="atk-sharp.dll" SIZE="186368" CHECKSUM="0xB5614E22" BIN_FILE_VERSION="2.12.0.0" BIN_PRODUCT_VERSION="2.12.0.0" PRODUCT_VERSION="2.12.0.0" FILE_DESCRIPTION=" " FILE_VERSION="2.12.0.0" ORIGINAL_FILENAME="atk-sharp.dll" INTERNAL_NAME="atk-sharp.dll" LEGAL_COPYRIGHT=" " VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x30ECC" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="2.12.0.0" UPTO_BIN_PRODUCT_VERSION="2.12.0.0" LINK_DATE="01/07/2014 01:39:58" UPTO_LINK_DATE="01/07/2014 01:39:58" VER_LANGUAGE="Independiente del idioma [0x0]" EXE_WRAPPER="0x0" />
    <MATCHING_FILE NAME="gdk-sharp.dll" SIZE="241664" CHECKSUM="0x6DFFF0CD" BIN_FILE_VERSION="2.12.0.0" BIN_PRODUCT_VERSION="2.12.0.0" PRODUCT_VERSION="2.12.0.0" FILE_DESCRIPTION=" " FILE_VERSION="2.12.0.0" ORIGINAL_FILENAME="gdk-sharp.dll" INTERNAL_NAME="gdk-sharp.dll" LEGAL_COPYRIGHT=" " VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x43754" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="2.12.0.0" UPTO_BIN_PRODUCT_VERSION="2.12.0.0" LINK_DATE="01/07/2014 01:40:02" UPTO_LINK_DATE="01/07/2014 01:40:02" VER_LANGUAGE="Independiente del idioma [0x0]" EXE_WRAPPER="0x0" />
    <MATCHING_FILE NAME="glade-sharp.dll" SIZE="33792" CHECKSUM="0x37CBE288" BIN_FILE_VERSION="2.12.0.0" BIN_PRODUCT_VERSION="2.12.0.0" PRODUCT_VERSION="2.12.0.0" FILE_DESCRIPTION=" " FILE_VERSION="2.12.0.0" ORIGINAL_FILENAME="glade-sharp.dll" INTERNAL_NAME="glade-sharp.dll" LEGAL_COPYRIGHT=" " VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0xE82D" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="2.12.0.0" UPTO_BIN_PRODUCT_VERSION="2.12.0.0" LINK_DATE="01/07/2014 01:40:18" UPTO_LINK_DATE="01/07/2014 01:40:18" VER_LANGUAGE="Independiente del idioma [0x0]" EXE_WRAPPER="0x0" />
    <MATCHING_FILE NAME="glib-sharp.dll" SIZE="93184" CHECKSUM="0x8E81BA23" BIN_FILE_VERSION="2.12.0.0" BIN_PRODUCT_VERSION="2.12.0.0" PRODUCT_VERSION="2.12.0.0" FILE_DESCRIPTION=" " FILE_VERSION="2.12.0.0" ORIGINAL_FILENAME="glib-sharp.dll" INTERNAL_NAME="glib-sharp.dll" LEGAL_COPYRIGHT=" " VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1B043" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="2.12.0.0" UPTO_BIN_PRODUCT_VERSION="2.12.0.0" LINK_DATE="01/07/2014 01:39:54" UPTO_LINK_DATE="01/07/2014 01:39:54" VER_LANGUAGE="Independiente del idioma [0x0]" EXE_WRAPPER="0x0" />
    <MATCHING_FILE NAME="gtk-sharp.dll" SIZE="1399808" CHECKSUM="0xCF74A67" BIN_FILE_VERSION="2.12.0.0" BIN_PRODUCT_VERSION="2.12.0.0" PRODUCT_VERSION="2.12.0.0" FILE_DESCRIPTION=" " FILE_VERSION="2.12.0.0" ORIGINAL_FILENAME="gtk-sharp.dll" INTERNAL_NAME="gtk-sharp.dll" LEGAL_COPYRIGHT=" " VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x15C983" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="2.12.0.0" UPTO_BIN_PRODUCT_VERSION="2.12.0.0" LINK_DATE="01/07/2014 01:40:09" UPTO_LINK_DATE="01/07/2014 01:40:09" VER_LANGUAGE="Independiente del idioma [0x0]" EXE_WRAPPER="0x0" />
    <MATCHING_FILE NAME="LightCreator.exe" SIZE="10752" CHECKSUM="0xD5D28E57" BIN_FILE_VERSION="0.1.5375.20160" BIN_PRODUCT_VERSION="0.1.5375.20160" PRODUCT_VERSION="0.1.5375.20160" FILE_DESCRIPTION="LightCreator" COMPANY_NAME="Ledmotive" PRODUCT_NAME="LightCreator" FILE_VERSION="0.1.5375.20160" ORIGINAL_FILENAME="LightCreator.exe" INTERNAL_NAME="LightCreator.exe" LEGAL_COPYRIGHT="Ledmotive 2014" VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="0.1.5375.20160" UPTO_BIN_PRODUCT_VERSION="0.1.5375.20160" LINK_DATE="09/19/2014 10:12:00" UPTO_LINK_DATE="09/19/2014 10:12:00" VER_LANGUAGE="Independiente del idioma [0x0]" EXE_WRAPPER="0x0" FILE_ID="00009e6f84923c0597ef3b370ba91ea90105ef77ffdd" PROGRAM_ID="0000da39a3ee5e6b4b0d3255bfef95601890afd80709" />
    <MATCHING_FILE NAME="Mono.Cairo.dll" SIZE="59904" CHECKSUM="0xCCDC21BD" BIN_FILE_VERSION="4.0.0.0" BIN_PRODUCT_VERSION="4.0.0.0" PRODUCT_VERSION=" " FILE_DESCRIPTION=" " COMPANY_NAME=" " PRODUCT_NAME=" " FILE_VERSION="4.0.0.0" ORIGINAL_FILENAME="Mono.Cairo.dll" INTERNAL_NAME="Mono.Cairo" LEGAL_COPYRIGHT=" " VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="4.0.0.0" UPTO_BIN_PRODUCT_VERSION="4.0.0.0" LINK_DATE="07/12/2013 07:49:31" UPTO_LINK_DATE="07/12/2013 07:49:31" VER_LANGUAGE="Idioma invariable (país invariable) [0x7f]" EXE_WRAPPER="0x0" />
    <MATCHING_FILE NAME="Mono.Posix.dll" SIZE="181248" CHECKSUM="0xF1A4B3A7" BIN_FILE_VERSION="2.0.0.0" BIN_PRODUCT_VERSION="2.0.0.0" PRODUCT_VERSION="2.0.0.0" FILE_DESCRIPTION="Mono.Posix.dll" COMPANY_NAME="" PRODUCT_NAME="" FILE_VERSION="2.0.0.0" ORIGINAL_FILENAME="Mono.Posix.dll" INTERNAL_NAME="Mono.Posix.dll" LEGAL_COPYRIGHT=" " VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="2.0.0.0" UPTO_BIN_PRODUCT_VERSION="2.0.0.0" LINK_DATE="01/09/2009 18:43:51" UPTO_LINK_DATE="01/09/2009 18:43:51" VER_LANGUAGE="Independiente del idioma [0x0]" EXE_WRAPPER="0x0" />
    <MATCHING_FILE NAME="pango-sharp.dll" SIZE="97280" CHECKSUM="0x23DE5420" BIN_FILE_VERSION="2.12.0.0" BIN_PRODUCT_VERSION="2.12.0.0" PRODUCT_VERSION="2.12.0.0" FILE_DESCRIPTION=" " FILE_VERSION="2.12.0.0" ORIGINAL_FILENAME="pango-sharp.dll" INTERNAL_NAME="pango-sharp.dll" LEGAL_COPYRIGHT=" " VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1CA73" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="2.12.0.0" UPTO_BIN_PRODUCT_VERSION="2.12.0.0" LINK_DATE="01/07/2014 01:39:55" UPTO_LINK_DATE="01/07/2014 01:39:55" VER_LANGUAGE="Independiente del idioma [0x0]" EXE_WRAPPER="0x0" />
</EXE>
<EXE NAME="KERNELBASE.dll" FILTER="CMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="KernelBase.dll" SIZE="274944" CHECKSUM="0x81EAFB25" BIN_FILE_VERSION="6.1.7601.18409" BIN_PRODUCT_VERSION="6.1.7601.18409" PRODUCT_VERSION="6.1.7601.18015" FILE_DESCRIPTION="Archivo DLL de cliente API BASE de Windows NT" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Sistema operativo Microsoft® Windows®" FILE_VERSION="6.1.7601.18015 (win7sp1_gdr.121129-1432)" ORIGINAL_FILENAME="Kernelbase" INTERNAL_NAME="Kernelbase" LEGAL_COPYRIGHT="© Microsoft Corporation. Reservados todos los derechos." VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x49E52" LINKER_VERSION="0x60001" UPTO_BIN_FILE_VERSION="6.1.7601.18409" UPTO_BIN_PRODUCT_VERSION="6.1.7601.18409" LINK_DATE="03/04/2014 09:19:02" UPTO_LINK_DATE="03/04/2014 09:19:02" EXPORT_NAME="KERNELBASE.dll" VER_LANGUAGE="Español (España, internacional) [0xc0a]" EXE_WRAPPER="0x0" FILE_ID="00000a832621f9dd06389f9f425e811d5e0127aedb60" PROGRAM_ID="0000f519feec486de87ed73cb92d3cac802400000000" />
</EXE>
<EXE NAME="kernel32.dll" FILTER="CMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="kernel32.dll" SIZE="1114112" CHECKSUM="0x5B25986C" BIN_FILE_VERSION="6.1.7601.18409" BIN_PRODUCT_VERSION="6.1.7601.18409" PRODUCT_VERSION="6.1.7601.18015" FILE_DESCRIPTION="Archivo DLL de cliente API BASE de Windows NT" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Sistema operativo Microsoft® Windows®" FILE_VERSION="6.1.7601.18015 (win7sp1_gdr.121129-1432)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32" LEGAL_COPYRIGHT="© Microsoft Corporation. Reservados todos los derechos." VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x1105AE" LINKER_VERSION="0x60001" UPTO_BIN_FILE_VERSION="6.1.7601.18409" UPTO_BIN_PRODUCT_VERSION="6.1.7601.18409" LINK_DATE="03/04/2014 09:19:01" UPTO_LINK_DATE="03/04/2014 09:19:01" EXPORT_NAME="KERNEL32.dll" VER_LANGUAGE="Español (España, internacional) [0xc0a]" EXE_WRAPPER="0x0" FILE_ID="00004cd3e572ae6f2f7913dd8f0da01340fffe5c47b0" PROGRAM_ID="0000f519feec486de87ed73cb92d3cac802400000000" />
</EXE>
</DATABASE>

其他信息:

因为错误是指gtk-sharp,我已将DLL复制到可执行文件的目录中(可以告诉Xamarin Studio在编译时放置DLL文件的副本)程序),但复制DLL文件并不能解决问题。

复制的DLL列表:

  • ATK-sharp.dll
  • GDK-sharp.dll
  • 林间空地-sharp.dll
  • 油嘴-sharp.dll
  • GTK的sharp.dll
  • Mono.Cairo.dll
  • Mono.Posix.dll
  • 的pango-sharp.dll

我还读过许多其他类似的StackOverflow线程......但我找不到任何可以帮助我的东西:

提前感谢您的建议。

2 个答案:

答案 0 :(得分:1)

我的猜测是你没有在PATH环境变量中配置GTK#的路径。尝试将以下目录添加到PATH:

C:\Program Files (x86)\GtkSharp\2.12\bin

您复制的其他dll已在GAC中注册,因此您的GTK#应用程序不需要它们在自己的目录中。

答案 1 :(得分:1)

尝试解决另一个问题(加载GTK主题),我找到了比复制DLL文件更好的解决方案。

诀窍是添加代码以“找到”“缺失”的DLL,就像Monodevelop所做的那样。以下链接中的更多信息:

How to load a GTK Sharp theme on MS Windows