We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

BadImageFormatException on 64 bit

Hi,

I have a class that instantiates licenses in the following way:

public DocumentControllerAspose() {

Aspose.Words.License wordsLicense = new Aspose.Words.License();
Aspose.Cells.License cellsLicense = new Aspose.Cells.License();
Aspose.Pdf.Kit.License pdfKitLicense = new Aspose.Pdf.Kit.License();
Aspose.Pdf.License pdfLicense = new Aspose.Pdf.License();

wordsLicense.SetLicense(“Aspose.Total.lic”);
cellsLicense.SetLicense(“Aspose.Total.lic”);
pdfKitLicense.SetLicense(“Aspose.Total.lic”);
pdfLicense.SetLicense(“Aspose.Total.lic”);
}

When the constructor is called a BadImageFormatException is thrown. It is fine on 32 bit systems. I am using the latest version of the above DLLs.

Thanks,

Adam

Hi,

Could you provide full stack trace, if possible (and please also indicate which product fails - i.e. is it wordsLicense, cellsLicense, pdfKitlicense or pdfLicense's SetLicense call)?

The stack trace probably isn’t going to tell you much as it’s all in my code:

at Adeptive.ResWare.Server.Controllers.DocumentControllerAspose…ctor()
at Adeptive.ResWare.Server.Controllers.ControllerFactory.GetDocumentController() in C:\Sandbox\ResWareHead\ResWare\Server\ControllerFactory.cs:line 67
at Adeptive.ResWare.Server.ResWareServer.AppStartup() in C:\Sandbox\ResWareHead\ResWare\Server\Server.cs:line 166
at Adeptive.ResWare.Server.ResWareServer.Main(String[] args) in C:\Sandbox\ResWareHead\ResWare\Server\Server.cs:line 66
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Here’s the full text of the error:

{" is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)"}

It looks like it’s puking for the Cells dll.


After you install Aspose.Cells, you can see two folders under the installed directory: .Net1.0 and .Net2.0. Please use the dll under .Net2.0 folder. It works fine with x64.

Hi,

The current version of Aspose.Pdf.Kit does not support x64 if you want to use PdfConverter, PdfExtractor and PdfViewer. This problem will be fixed late next month. Sorry for the inconvenience.

Hi,

I replaced the Cells.dll and things appear to work now thankyou.

What exactly in pdf.kit does not work in x64? We’re using PdfFileEditor Concatenate method and it seems to work fine…