I have some addins from the System.AddIn. But when running the AddInStore.Rebuild,
string[] warnings = AddInStore.Rebuild(addInRoot);
then I get a warning string back:
The file is not a valid binary: D:\AK\AS\ConverterModule\output\AddIns\CompositeFileZip\7z.dll File Name: D:\AK\AS\ConverterModule\output\AddIns\Composi...
The 7z.dll is not the addin assembly, but the 7z file that the CompositeFileZip addin uses. I can't quite figure out what exactly the rebuild function is doing. Is it trying to add the 7z.dll as an addin?
I'm not familiar with System.AddIn or the 7z component, but a very common cause of
BadImageFormatException
is attempting to load an assembly that is marked as 64-bit (or dependent on a native 64-bit .dll) on a 32-bit system, or vice versa.Check whether your
7z.dll
and its dependencies are built for the same architecture as the system where you see theBadImageFormatException
. You can do this from a Visual Studio command prompt by dumping the headers for7z.dll
and looking for the machine architecture: