简体   繁体   English

在VS中添加对dll的引用

[英]Adding a reference to dll in VS

I've got some strange behaviour in my project.. I have one that needs to recieve o couple of forms from other project. 我的项目中有一些奇怪的行为。我有一个需要从其他项目中接收几种形式的行为。 Logic in theese forms requires some external dlls. 这些形式的逻辑需要一些外部dll。 So, I copypasted theese forms, added references, but i get an error "Could not load file or assembly or one of its dependencies." 因此,我复制粘贴了这些表格,添加了引用,但出现错误“无法加载文件或程序集或其依赖项之一”。 So, after some time I decided to delete references in second project to see what i'm missing. 因此,一段时间后,我决定删除第二个项目中的引用,以查看缺少的内容。 And after adding theese references back i also got this error. 在添加这些参考文献之后,我也遇到了这个错误。 How could this happen? 怎么会这样 I thought that i missed some extra links in my first project so it didn't work, but is seems to be not exactly correct. 我以为我在第一个项目中错过了一些额外的链接,所以它没有用,但似乎并不完全正确。

If you are using visual studio for your development, you should be able to see all the added references under project references. 如果您使用Visual Studio进行开发,则应该能够在项目引用下看到所有添加的引用。

Make sure the dlls you are referring to show up under references. 确保您要引用的dll显示在引用下。 Then make sure you are importing the appropriate namespaces where you want to make calls to data or objects in your dlls. 然后,确保要导入适当的名称空间,以在其中调用dll中的数据或对象。

You can view the name spaces by double clicking on the reference you want to view. 您可以通过双击要查看的引用来查看名称空间。 It should give you list of all the methods and the namespaces they are under in object browser. 它应该为您提供对象浏览器中所有方法及其名称空间的列表。

If everything is there, I would clean the solution and then rebuild the entire solution. 如果一切就绪,我将清理解决方案,然后重新构建整个解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM