Page 1 of 1

Applix.Tm1.API could not be loaded

Posted: Fri Feb 04, 2011 11:25 pm
by winsonlee
Could not load file or assembly 'Applix.TM1.API' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I have installed cognos express trial edition on my machine. I presume the trial is a 32bit software.
I am doing testing on two platform, Windows XP 32 Bit and Windows 2003 Server 64 bit.
I am trying to create reports that connect to TM1 using asp.net.

On windows xp 32 bit, i hav no issue running the report on the IIS.
When i try running the report using IIS on WIndows 2003 Server 64 bit, I get the above error msg.

I installed VS 2010 on the Windows 2003 Server 64 bit and try running Debugging process on the code and the code runs just fine.

Am I missing some settings on the IIS server on the windows 2003 ?

Re: Applix.Tm1.API could not be loaded

Posted: Sat Feb 05, 2011 12:14 am
by Mike Cowie
Hi:

First, I'm curious why you've jumped to building a custom ASP.NET application rather than try to use native Cognos Express components to build web-based reports against TM1 (e.g., use TM1 Web with Active Forms)? I'm not suggesting that TM1 Web and other Cognos Express components will do everything you've ever wanted to do, exactly as you wanted to do them in a report, but if you can accomplish what you need without custom development you'll end up with a much simpler application to support in the long-run.

Regardless, I'll say up front that I'm not super-experienced with the .NET API, but I have worked with the C/VB API quite a lot. This error is indicative of an issue you can encounter in that API, too, which is that it sounds like the version of the TM1 .NET API that you've used in building and deploying your ASP.NET application is the 32-bit version. I'm making this assumption based on the fact that you say you are attempting to use it in IIS running in 64-bit mode (where it fails to work) and that it does work on your 32-bit development machine. The error message is simply telling you that you're attempting to run the application in a format (the host application format, IIS 64-bit) that doesn't match the format of one or more assemblies (Applix.TM1.API is the one highlighted in your error message).

You have 2 options to get around this:
1) Find the 64-bit version of the TM1 .NET API and compile/deploy your ASP.NET application with it, explicitly as a 64-bit application for use on your 64-bit server/IIS host.
2) Configure IIS to run in 32-bit mode rather than 64-bit mode with your 32-bit version of the TM1 .NET API. WARNING: changing this could royally screw up other IIS web applications like TM1Web, which I would assume are currently working just fine, so do this at your own risk.

Now, where I'm a bit fuzzy is whether or not Cognos Express includes both the 32-bit and 64-bit versions of the .NET API files. If it does *not* include the 64-bit .NET API, you may need to contact IBM and ask them for it. Before you do that, you should be able to establish if there are both 32-bit and 64-bit versions by searching the machine for the .NET API file Applix.TM1.API.dll and seeing if there are multiple copies with different file sizes within the same installation of Cognos Express (one of them would, presumably, be the 64-bit version).

As to why this works when you run it in debug mode, there could be one of the following things happening:
1) You're allowing Visual Studio to use the built-in ASP.NET host/development web server when it is debugging, rather than hosting within IIS, and that ASP.NET debugging host is probably a 32-bit app.
2) Visual Studio 2010 in your server environment is smart enough to recognize that you've got a 32-bit component and is making sure to configure IIS run it as a 32-bit web app when you debug it (I kind of doubt it will do this for you - I really think you're using the built-in, default ASP.NET host web debugger).

Hope this at least gives you some things to think about/try.

Regards,
Mike

Re: Applix.Tm1.API could not be loaded

Posted: Mon Feb 07, 2011 12:10 pm
by winsonlee
hi

thanks for the reply. second option works. earlier aspx file was executed using 4.0 .net framework 64 bit. i change it to 4.0 .net framework 32 bits and it works.