Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi everyone,

I want to add dll file into my project for RFID card reader. This card reader is third party. They given dll file for this device. However, I can't add dll file into my project. How can I solve this problem.

Error is

A reference to 'mydll.dll' could not be added.


step by step is

R-Click upon my project. Choose Add reference and Click Browse tap,

Choose path and click dll file. Finally, click ok. The following file occurs

A reference to 'mydll.dll' could not be added.


Help me plz...

This dll files is created by C++. However, I try to use with VB.net. I want to know it OK or not. Thank for all help :0
Posted
Updated 23-Apr-12 21:34pm
v2

For a .NET project/solution you add only a .NET assembly or COM dll as reference.
Check if your dll is CLR compatible. You try to open this in IL dissembler and check if all is right
 
Share this answer
 
Comments
Member 14892691 18-Jul-20 10:21am    
How to add .NET assembly or COM dll as reference
Imports System
Imports System.Runtime.InteropServices
Imports System.Text

Module yourModuleName

Public Const parameterString  As String = "yourdll.dll"

 <dllimport(parameterstring> _
    Public Function HF_Port_Open() As Int32
    End Function

End Module


It's OK all.
 
Share this answer
 
I have had an error like this once a while back, what i did to fix it was I copied the .dll files into the project folder.
example: C:\Users\staff\Documents\Visual Studio 2010\Projects\app1\app1\includes\
then I added the ref there. This was a while back and I think I did some fiddling with it.
I don't know if this comment will help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900