473,466 Members | 1,294 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

FileLoadException - what's wrong with my assembly?

Hi,

In C++/CLI (with VS2005 beta2) I wrote a little wrapper around a native dll
(to which I headers and .lib). Wrapper was a ref class with some methods
calling native functions from native dll. It all compiled and linked fine
giving me an assembly dll. Sweet.

Then I created C# project and added a reference to my wrapper. In C# I
created intance of a wrapper class and called some of its methods. Again it
compiled with no problem. Veery sweet I thought... and I was wrong.

As soon I as ran C# project I got FileLoadException thrown. The message was:
A procedure imported by [my wrapper assembly name] could not be loaded.

So here I am. Standing suprised, not knowing what's wrong with my assembly.
Any ideas? :)

Nov 17 '05 #1
2 6477
moose wrote:
Hi,

In C++/CLI (with VS2005 beta2) I wrote a little wrapper around a
native dll (to which I headers and .lib). Wrapper was a ref class
with some methods calling native functions from native dll. It all
compiled and linked fine giving me an assembly dll. Sweet.

Then I created C# project and added a reference to my wrapper. In C# I
created intance of a wrapper class and called some of its methods.
Again it compiled with no problem. Veery sweet I thought... and I was
wrong.

As soon I as ran C# project I got FileLoadException thrown. The
message was: A procedure imported by [my wrapper assembly name] could
not be loaded.

So here I am. Standing suprised, not knowing what's wrong with my
assembly. Any ideas? :)


Use dependency walker on your wrapper assembly to check if all the necessary
native DLLs are available.

Arnaud
MVP - VC
Nov 17 '05 #2
"Arnaud Debaene" wrote:
Use dependency walker on your wrapper assembly to check if all the necessary
native DLLs are available.


I used depenedancy walker and got the problem solved :) Thx man.
In fact the problem was not missing native DLL but the old version of DLL (I
used the latest .lib to compile wrapper and then tried to bind to old DLL).
--
moose

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Daniel Mori | last post by:
Im at a loss on where to proceed next. I wonder if anyone can help me. I have a managed C++ DLL is basically a thin wrapper around several unmanaged classes. This DLL builds fine. In my...
1
by: ptass | last post by:
Does anyone know what causes and how to prevent getting System.IO.FileLoadException everytime you launch a new version of an .exe via a href. ? The full error reads...An exception...
4
by: ptass | last post by:
Does anyone know what causes and how to prevent getting System.IO.FileLoadException everytime you launch a new version of an .exe via a href. ? The error reads...An exception...
6
by: Ken Varn | last post by:
I am trying to remote debug a C# application but the debugger is reporting the following exception: An unhandled exception of type 'System.IO.FileLoadException' occurred in Unknown Module....
2
by: Bern McCarty | last post by:
I am getting the following error when one of my mixed-mode assemblies trys to call a method in another. Both are strongly named, neither are in the GAC. Execution is in a non-default AppDomain in...
1
by: Jeremy Chapman | last post by:
Sometimes users are reporting that they receive a FileLoadException error saying that access to a dll is denied. This has occured after strong naming my dlls for my web apps, and it seems to be...
4
by: jeeji | last post by:
Hi I have a console application that in some cases could get a System.IO.FileLoadException Could not load file or assembly XXX, Version=5.0.0.0, Culture=neutral, PublicKeyToken=YYYY' or one of...
1
by: vickyvick | last post by:
Hi, the only code that is present in main is given below string filePath; FileIOPermission FilePermission = new FileIOPermission(PermissionState.Unrestricted); FilePermission.AllLocalFiles =...
5
by: Berryl Hesh | last post by:
Goal: Use an example project I found which illustrates use of design patterns that facilitate unit testing, so I can incorporate these patterns into my own projects. One pattern is built on...
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...
1
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.