如何在visual studio 2012 c#windows应用程序中包含.dll(特别是“c”) [英] How to include .dll (specifically "c") in visual studio 2012 c# windows application
本文介绍了如何在visual studio 2012 c#windows应用程序中包含.dll(特别是“c”)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我成功创建了c.dll,但是我无法在visual studio参考中包含,我收到以下错误:
无法添加对test.dll的引用。请确保该文件是可访问的,并且它是有效的程序集或COM组件。
请参阅屏幕:
http://s1.postimg.org/dxb8fwjqn/screen.png [ ^ ]
解决方案
你不加C DLL文件作为参考:只能引用.NET程序集。
要在C#代码中使用C DLL文件,需要使用DLLImport: MSDN [ ^ ]
I created c ".dll" successfully, but iam not able include in visual studio reference, I got the following error:
A reference to "test.dll" could not be added. please make sure that the file is accessible and that it is a valid assembly or COM component.
Refer the screen:
http://s1.postimg.org/dxb8fwjqn/screen.png[^]
解决方案
You don't add C DLL files as references: only .NET assemblies can be referenced.
To use a C DLL file in your C# code, you need to use DLLImport: MSDN[^]
这篇关于如何在visual studio 2012 c#windows应用程序中包含.dll(特别是“c”)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文