I'm attempting to proxy an existing dll that I don't have all the source code to. I'm using a tool I found here:
https://github.com/mavenlin/Dll_Wrapper_Gen
Using it, I was able to create a Visual Studio project and build it successfully. However, when running the original executable, it throws an exception for "badimageFormatException". After getting some unhelpful comments-but-not-answers here on SO in another question, I discovered what I think to be the essential differences between the proxy dll and original.
Using the corflags.exe tool (from VS, also looks like dumpbin has the right features too, but I couldn't figure them out), I get the following output for the original:
C:\Users\jo\fml2>"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\Co
rFlags.exe" fml.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 3.5.30729.1
Copyright (c) Microsoft Corporation. All rights reserved.
Version : v1.1.4322
CLR Header: 2.0
PE : PE32
CorFlags : 0
ILONLY : 0
32BIT : 0
Signed : 0
If I use the same tool on the proxy dll, I get this:
corflags : error CF008 : The specified file does not have a valid managed header
What do I need to add to my code to make it match that?