views:

32

answers:

1

We have a project built with vs2010 which utilizes a .dll with managed code. I've built the .dll in vs2010, target Framework .NET 4.0 (tried Client Profile as well), which is the only option 2010 gives you to use. When I go to run it, it can't initialize and I assume it's some incompatibility...but I have no idea what it would be. Does anyone have any ideas?

Also, I have downloaded a hotfix which allows you to do Incremental Managed Builds (originally it wasn't a feature in 2010)

Thanks!

+1  A: 

Exception 0xc000007b (STATUS_INVALID_IMAGE_FORMAT) is almost always generated on the 64-bit version of Windows. Because your program is running in 64-bit mode and trying to load a DLL that contains unmanaged 32-bit code. Or the other way around.

Make sure the managed assembly was built with the Platform Target set to Any CPU. That isn't the default anymore in VS2010. Project + Properties, Build tab, Platform target setting. Be sure to change it for both the Debug and the Release configuration.

If you have no clue what DLL it might be then observe the program loading the DLL with the SysInternals' ProcMon utility.

Hans Passant
Ramon Johannessen
So, does it run on a 64-bit version of Windows? No, I was talking about the C# project setting. Which shouldn't matter with that target machine setting. Dependency Walker isn't a good tool anymore, it has trouble with the side-by-side cache, try ProcMon to find the trouble maker. Also, don't deploy the debug build, you cannot distribute msvcr90d.dll
Hans Passant
Not sure about 64bit, don't have one available atm. The C# project was correctly set. I'll figure out how to use ProcMon now, thanks for the help btw.
Ramon Johannessen
OK, I'm having a heck of a time figuring out how to use procmon to find which one it is. Any tips?
Ramon Johannessen
File + Save. Copy the file to a file sharing service so we can take a look at it.
Hans Passant
So I run ProcMon, run the project.exe, and quick do a capture in ProcMon? is that right?
Ramon Johannessen