简体   繁体   中英

C# error: adding reference to .dll file

I have my project file and Calculator01.dll file in same directory. When I'm trying to add a reference to Calculator.dll file message box appears and show

"A reference to 'E\\IT131344............Calculato01.dll could not be added. Please make sure file is accessible and that it is a valid assembly or COM component."

I have already marked class functions with in CalDllWrapper class;

[DllImport("Calculator01.dll")]

Solutions I have found so far does not work for me. What can I do to resolve this problem? Please help me. thanks in advance

You can not add references to unmanaged DLLs. Only managed DLLs can be referenced. Unmanaged DLLs can only be used by using the DllImport attribute. Please note that the application needs to be able to access the DLL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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