如何解决此错误:在Visual Studio 2015中找不到DLL? [英] How can I solve this error : DLL not found in visual studio 2015 ?

查看:1445
本文介绍了如何解决此错误:在Visual Studio 2015中找不到DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我有一个与dll相关的问题。

我放功能时也没有错误从我的项目中的DLL,但是当我使用这些函数运行项目时,我从其中一个无法找到dll的错误中得到错误。

我从示例项目中获取了该dll我安装了XL驱动程序库(Vector),如果我运行该项目它可以工作,但是当我在我的项目上使用它时它不起作用。

如何解决这个问题? />


谢谢。



我的尝试:



我通过使用添加引用在我的项目中添加了dll。

还有别的我需要做的因为在另一个项目中我添加了dll使用添加参考和功能工作。

Hello,

I have a problem related to a dll.
Also I don't have errors when I put the functions from the dll in my project but when I run the project using the functions, I get an error from one of the funstions that the dll could not be found.
I took that dll from an example project when I installed the XL driver Library (Vector) and if I run that project it works, but when I use the dll on my project it doesn't work.
How can I resolve this problem?

Thanks.

What I have tried:

I added the dll on my project by using "Add Reference".
Is there something else that I have to do because on another project I added the dll by using "Add Reference" and the functionality worked.

推荐答案

没有看到你的代码,并且能够正确地看着你在做什么,我们不能真的告诉。

但是......有两种类型的DLL文件:.NET识别并需要添加引用的程序集,以及它不支持的动态链接库(也称为本机库)但是你没有。



所以首先要仔细查看错误信息:它会给你它正在寻找的DLL文件的名称。检查项目中的内容:是否在引用列表中?如果是,请检查它是否与项目的CPU类型相同,并且参考属性选项复制本地设置为true。

如果不是,请尝试添加它。如果可行,请尝试重建。如果没有,那么它可能是本机库,您需要确保DLL位于EXE文件夹中,或者在Windows用于查找可执行文件的当前PATH上的文件夹中。
Without seeing your code, and being able to look over your shoulder at exactly what you are doing we can't really tell.
But ... there are two types of DLL files: Assemblies which .NET recognises and which require a Reference to be added, and Dynamic Link Libraries (also known as Native libraries) which it doesn't, and you don't.

So start by looking at the error message closely: it will give you the name of the DLL file it is looking for. Check for that in your project: is it in the references list? If it is, check that it's built for the same CPU type as your project, and that the Reference properties option "Copy Local" is set to true.
If it isn't, try adding it. If that works, try rebuilding. If it doesn't, then it's probably a Native Library, and you need to ensure that the DLL is either in the EXE folder, or in a folder on the current PATH that Windows uses to locate executables.


这篇关于如何解决此错误:在Visual Studio 2015中找不到DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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