By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,513 Members | 1,650 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,513 IT Pros & Developers. It's quick & easy.


P: 2
Hi folks,

I get troubles in calling C++/CLI class library from C#. Here is what I did and what I got (I use VS 2005):

+ I have a pure Win32 DLL built by VC++ (by choosing Win32 Project in New Project Menu), using libraries from OpenSSL, MySQL and libxml2. The DLL was compiled and linked successfully, I got 2 files, let's call them: Native.dll and Native.lib
+ I wrote a wrapper for Native.lib in C++/CLI (by choosing CLR Class Library), this DLL was compiled and linked successfully too, I got another file, called Wrapper.dll
+ Now I write a C# console application, I added ref to Wrapper.dll. I can compile it, but when I launch this C# application, I got FileNotFoundException.

Does anyone have the same issue, please give me some hint.

Thanks in advance,
May 25 '07 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 5K+
P: 9,197
Have you loaded the dll library?

Expand|Select|Wrap|Line Numbers
  1. System.load("C:\\somewhere\\native.dll");
May 25 '07 #2

P: 2
Sorry, correct me if I'm wrong, but I checked MSDN and saw that System.load is J# method.

It seems that my problem was reported here:

I followed 2 workarounds described in that bug report, they didn't work.

And then I build Native.dll as static lib, this time, my C# application can use my C++/CLI wrapper correctly. But I don't like the idea of using static lib, because I use many libs such as: openssl, libxml2,... The Native.lib I got gets pretty big in size.

Any idea, dude?

May 25 '07 #3

Expert Mod 5K+
P: 9,197
You are right. Sorry.

There is a DLL class that extrends Object.
May 25 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.