MC++ - System.IO.FileLoadException - Unverifiable image 'MyAssembly' can not be run.

B

Bern McCarty

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 case that matters.
MyAssembly is actually an exe rather than a dll. It is really just a
library but I use it's main entry point as a test of the library itself. So
there is an object in elementtest.dll who's source contains a statement:
#using <MyAssembly.exe>. Is that what is causing the problem? Must I make
the assembly have a dll extension to avoid this error for some reason?

A first chance exception of type 'System.IO.FileLoadException' occurred
in elementtest.dll

Additional information: Unverifiable image 'MyAssembly' can not be run.
 
G

Guest

I remember reading somewhere that you can't use a .exe as a dll, even though the compilier allows it. So, yes, that is probally what is causing it. I just wish I could figure out where I read it to get more information.
 
B

Bern McCarty

I eliminated the main and changed it from an .exe to a .dll and, sure
enough, problem gone.

mccoyn said:
I remember reading somewhere that you can't use a .exe as a dll, even
though the compilier allows it. So, yes, that is probally what is causing
it. I just wish I could figure out where I read it to get more information.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top