Reputation: 11
I am trying to import a .dll file which is written in C to Microsoft Visual C# Studio 2010?
Any ideas why I keep on getting this error?
Please make sure that the file is accessible and that it is a valid assembly prompt.
Upvotes: 1
Views: 389
Reputation: 21723
I suspect you're not using the DllImportAttribute
correctly (or at all). See here:
http://msdn.microsoft.com/en-us/library/aa984739(v=vs.71).aspx
Upvotes: 0
Reputation: 613461
You cannot import a reference to a native DLL. Instead you need to use p/invoke to import each function one by one. This can be a rather laborious process if you have a lot of functions so sometimes a C++/CLI wrapper is more convenient.
Upvotes: 1