MonoDevelop中的DLL问题 [英] DLL Problem in MonoDevelop

查看:125
本文介绍了MonoDevelop中的DLL问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我叫Vikas Gohil.

我已经使用VS2005在C#中开发了一个应用程序.该应用程序使用在C中创建的第三方DLL文件.我使用DLLImport语句导入DLL文件并使用该文件中的函数.该应用程序在Windows上的VS2005中运行良好.

我已将DLL文件放在存在我的应用程序(.exe)文件的文件夹中.然后,我将整个项目文件夹复制到Ubuntu,并使用MonoDevelop 2.4打开项目.

打开后,我的项目可以正确编译,并且没有显示错误.当我运行应用程序时,将调用Main方法,并且应用程序将正确启动.但是,当我使用DLL的功能时,它将引发一个异常DLLFileNotFound.我不明白

根据( TR:我认为这是Acc.的意思),Mono主要在应用程序文件夹本身中搜索,但仍然出现此错误.有人可以在这件事上指导我吗.任何帮助都会很棒,因为我是MonoDevelop的新手.

在此先感谢您,稍后将等待回复.

Hello, this is Vikas Gohil.

I have developed an application in C# using VS2005. The application is using a third party DLL file created in C. I am using DLLImport statements to importing the DLL file and using functions from that file. This application works fine in VS2005 on windows.

I have put the DLL files in the folder where my application (.exe) file is present. I then copied the full project folder to Ubuntu, and used MonoDevelop 2.4 to open the project.

After opening my project compiles properly and shows no errors. When I run the application, the Main method is called and the application starts properly. But, when I use the function of DLL, it throws an exception, DLLFileNotFound. I don''t understand this.

According (TR: I think this is what you meant by Acc.) to the MonoDevelop site, Mono primarily searches in the application folder itself, but I still get this error. Can someone guide me in this matter. Any help would be great, as I am a newbie to MonoDevelop.

Thanks in advance, awaiting a reply soon.

推荐答案

您真的想避免在Mono中使用DllImport. DLL不能像Mono EXE一样容易地在操作系统之间传输,这尤其是因为Ubuntu不知道如何处理Windows DLL(Windows无法处理Ubuntu共享库).考虑使用Mono库在C#中重新实现DLL的功能.传输起来会容易得多.
You really want to avoid using DllImport in Mono. DLLs don''t transfer across operating systems as easily as Mono EXEs, not least because Ubuntu won''t know what to do with a Windows DLL (and Windows won''t be able to handle an Ubuntu shared library). Consider re-implementing the functions of the DLL in C# using the Mono libraries. It''ll be a lot easier to transfer.


这篇关于MonoDevelop中的DLL问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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