using unmanaged dlls from managed dll wrappers.
- From: "drawing in aspnet" <csharpuser@xxxxxxxxxxx>
- Date: 1 Feb 2006 12:35:32 -0800
Hi, I hope someone can direct me to the correct newsgroup if this one is not correct. I have a unmanaged C++ dll that I need to use from a C# client. Rather than use dllImport directly, I created a managed C++ dll (in the same solution). In this managed C++ dll, I added a reference (under references) to the unmanaged dll (it's listed under the project tab). I also had to #include the header file for the unmanaged dll in my managed code. Then I created a C# client (.exe.) in my solution to test this idea. In the C# client I simply added a reference to the managed C++ dll. All worked great and I was happy. Now two weeks later, I would like to use this stuff from a real project. From a C# class library (which is used by my C# exe), I call into my C++ managed dll. I of course had to add a reference to the C++ managed dll. Everything compiled. However, when I run, I get the following runtime error: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in CSharpLibrary.dll. Additional Information: File or assembly name ManagedConverterWrapper, or one of its dependencies, was not found ManagedConverterWrapper is the managed C++ wrapper I wrote. I tried adding a reference in my C# class library to the unmanaged C++ dll using the 'Add Reference' tab. It did not work (got error saying could not add non DotNet dll) . Curiously, I was able to add a reference to the unmanaged dll to my managed C++ dll. Was that because it was within same solution or does C++ behave differently with respect to adding references. I also tried copying the unmanaged dll everywhere I could think of (bin/debug of C# class library and C# exe). No luck! My questions are: 1. When one uses a managed C++ dll that in turn makes use of unmanaged dlls, what else must one do to get things working? I.e. Compiler settings, additional references, file copying, etc. 2. Why did everything work fine when all the project where within one solution? Thanks in advance for any pointers, advice or references. Dave. .
- Follow-Ups:
- Re: using unmanaged dlls from managed dll wrappers.
- From: Lloyd Dupont
- Re: using unmanaged dlls from managed dll wrappers.
- Prev by Date: Unable to install the .NET 1.1 sp1
- Next by Date: Re: "Couln't find library MSVCR80.dll" with ASP.Net 2.0
- Previous by thread: Unable to install the .NET 1.1 sp1
- Next by thread: Re: using unmanaged dlls from managed dll wrappers.
- Index(es):
Relevant Pages
|
Loading