under the dot net 2.0 framework I get the following error when i use a mixed mode dll with in a vb.net windows service. System.BadImageFormatException: Invalid access to memory location. (Exception from HRESULT: 0x800703E6). This dll works fine if used in a vb.net standalone application. Any ideas what may be the cause

error when using a mixed mode dll in a windows service
MarkBuckland
matttypething
You might be missing the runtime support Dlls. If you're MFC and C++ you'll need the manifest stuff.
http://msdn2.microsoft.com/en-us/library/ms235264.aspx
sirck
Interesting I have found that this mixed mode dll will work in the service if its linked directly to the service. or if i pre load the assimbly with loadfrom. It seems to be some type of native vs managed load issue. I also get the same error when i try to use this dll in my webapp or webservice.
System.BadImageFormatException: Invalid access to memory location. (Exception from HRESULT: 0x800703E6)
Giles Nutkins
varadaraj
Hi,
I had similar sittuation, the trick was to add the nonmanaged dll to the system PATH. The problem (if I recall cofrrectly) was that my managed dll was copied and executed from some cashed .NET location, not from the directory where I compiled it, so it was not able to find my nonmanaged dll.
Max
Glen Clark