FileNotFoundException

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cmc123
    New Member
    • May 2007
    • 2

    FileNotFoundException

    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 FileNotFoundExc eption.

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

    Thanks in advance,
    -cmc123
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Have you loaded the dll library?

    [code=c]
    System.load("C: \\somewhere\\na tive.dll");
    [/code]

    Comment

    • cmc123
      New Member
      • May 2007
      • 2

      #3
      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: http://connect.microso ft.com/VisualStudio/feedback/ViewFeedback.as px?FeedbackID=9 8744

      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?

      -cmc

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        You are right. Sorry.

        There is a DLL class that extrends Object.

        Comment

        Working...