在Mono中使用预编译的.NET Assembly DLL? [英] Using Precompiled .NET Assembly DLL in Mono?

查看:141
本文介绍了在Mono中使用预编译的.NET Assembly DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前正在测试Mono,以查看我们的.NET DLL是否适用于Linux上的客户.我们的DLL提供了Windows窗体的组件.我将DLL放置在Debug目录中,添加了引用,并创建了一个从Windows窗体派生的类.该类可以很好地独立运行,但是在我添加了DLL引用并创建了我们的组件之一之后(智能感知很好),它可以编译但无法运行:

We're currently testing Mono to see if our .NET DLLs will work for customers on Linux. Our DLLs provide components for Windows Forms. I placed the DLLs in the Debug directory, added the references, and created a class deriving from a Windows Form. The class had run fine standalone, but after I added the DLL references and created one of our components (the intellisense worked fine), it compiles but will not run:


** (/home/aldwin/testMonoWF/testMonoWF/bin/Debug/testMonoWF.exe:26905): WARNING **: Could not load file or assembly 'OUR.ASSEMBLY, Version=1.0.0.1, Culture=neutral, PublicKeyToken=ATOKEN' or one of its dependencies.

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'OUR.ASSEMBLY, Version=1.0.0.1, Culture=neutral, PublicKeyToken=ATOKEN' or one of its dependencies.
File name: 'OUR.ASSEMBLY, Version=1.0.0.1, Culture=neutral, PublicKeyToken=ATOKEN'

我查看了程序集的属性,它是带有该公钥的版本.

I looked at the properties of the assembly, and it is that version with that public key.

有没有办法让我使用这些DLL?我在做什么错了?

Is there a way for me to use these DLLs? What am I doing wrong?

根据MoMA,除了某些与情况无关的[MonoTodo],在三个DLL中存在一个问题:

According to MoMA, other than some [MonoTodo]s that have no bearing on the situation, there is one problem in three of the DLLs:


Calling Method | P/Invoke Method | P/Invoke Library
void OnHandleCreated (EventArgs) | int GoText/ComboBoxControl.SetWindowTheme (IntPtr, string, string) | uxtheme.dll

但是,我打开了一个用VS2008创建的示例项目,将对DLL的引用指向正确的位置,并且工作正常.但是我无法获得在新项目中工作的参考.我在做错什么吗?

However, I opened one of our sample projects created with VS2008, pointed the reference to the DLL at the right place, and it worked fine. But I could not get the reference to work in a new project. Am I doing something wrong?

为了澄清,我们不想重新创建现有的Windows应用程序-我们正在模拟一个客户,使用我们的dll创建一个新的应用程序.我只是测试一下,看是否是dll问题.由于VS制作的应用程序能够找到dll并成功运行,因此这似乎不是dll问题.新的应用程序没有调用VS创建的应用程序没有的任何内容.

EDIT 2: To clarify, we don't want to recreate an existing windows application - we are simulating a customer creating a new application with our dll. I was just testing that to see if it was a dll problem. Since the VS-made application was able to find the dll and run successfully, it would seem it's not a dll problem. The new application is not calling anything the VS-created application doesn't.

推荐答案

我将使用 MOMA(单声道迁移分析器),以查看其是否使用了不受支持的API.

I'd test the DLL with MOMA (Mono Migration Analyzer) to see if it's using unsupported API's.

这篇关于在Mono中使用预编译的.NET Assembly DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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