473,405 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

FileNotFoundException

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,
-cmc123
May 25 '07 #1
3 2566
weaknessforcats
9,208 Expert Mod 8TB
Have you loaded the dll library?

Expand|Select|Wrap|Line Numbers
  1. System.load("C:\\somewhere\\native.dll");
  2.  
May 25 '07 #2
cmc123
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: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=98744

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
May 25 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
You are right. Sorry.

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

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

Similar topics

1
by: ulf | last post by:
Hello, After I got a FileNotFoundException in my real life CSharp code, I nailed it down to the following line: System.EnterpriseServices.ResourcePool rp = new...
2
by: Michael Sanford | last post by:
I'm getting a Sysmte.IO.FileNotFoundException when executing the code below. It is straight from the example. This works on one machine, but not the other. Other benign calls invoke the same...
0
by: Daylor | last post by:
any suggestions, why FileNotFoundException is throw , when im try to send object from appdomain to other ? (the object inherits MarshalByRefObject) i dont have a clue what the VS.2003 want...
3
by: Nick | last post by:
Hello, Let me explain my situation. There is an application in C++ (that I didn't write) that needs to call a C# DLL. One option, I believe, would be to compile the app with the clr switch....
5
by: MattC | last post by:
Hi, I am getting the following error: System.IO.FileNotFoundException: C:\Dreamtxt\WebSites\mysite\www\feedback.aspx at System.Web.UI.TemplateParser.GetParserCacheItem() at...
3
by: James | last post by:
Hi guys Do you ever get the exception in Managed C++? How can I know which file or dll is missed?
5
by: SGRing | last post by:
I have a c# application that I'm migrating from 2003 to 2005, and I moved it to another machine. It built ok. But, when trying to run I get System.IO.FileNotFoundException was unhandled...
0
by: Peter Vestergaard | last post by:
Hi, I am running VS .Net 2005. I have an application in which one of the classes are having a member that is an instance of a class defined in a managed C++ dll. As soon as I try to create an...
2
by: jjlagtap | last post by:
Hey everyone When I try to open a file i get the Exception listed below. The weird thing is it works when I run the web app locally and when i use a remote server and open a file on my computer....
2
by: bbindae | last post by:
I am trying to check whether XmlTextReader reads the xml file successfully or not. MSDN says that XmlTextReader raise the FileNotFoundException when it cannot find the file to read. Here is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.