3 comments
I have been working on a project recently which requires me to integrate with QuickBooks Online, in this case from a web application.  I have had the pleasure (strong word) working with integrating with QuickBooks in various capacities in the past and although it is not trivial, it does work.  I ran into an interesting problem recently with an error that baffled me.

While attempting to connect to QuickBooks online from my ASP.NET C# application, I received the following COM Exception:

Retrieving the COM class factory for component with CLSID {3C801F08-CDC5-4129-AAE8-CCC4F116B5BE} failed due to the following error: 80040154.

Searching the various Intuit Developer Forums led me nowhere.  I was thinking it may be the fact I am funning on Windows 7 and figured it might be an incompatibility with Windows 7 and the COM components from Intuit in their QuickBooks SDK.  After various Google searches I picked up a few clues to the source of the problem, which in hindsight should have been a bit more obvious to me.
64-Bit Friend and Foe

The root of the problem was not really Windows 7 but the fact I am running 64-bit and Visual Studio 2008 defaults the Platform Target to “Any CPU” when building a project.  So selecting Project-> {project name} Properties show the following dialog with Any CPU selected:

ProjectBuildProperties

By changing the choice of the Platform Target to x86 and rerunning my application, the creation of the session to QuickBooks Online works fine.  The idea should have probably been more obvious to me, knowing the DLL’s from Intuit are 32-bit COM-based and the interop to my 64-bit operating system could cause some problems.


Go to Build --> Configuration Manager
In Configuration Manager Change the Platform to X86 if you dont find it then select new and name it as X86 and copy select copy settings from Any CPU

If anyone wants to add the technical details as to why this behaves as it does, I will update this post with those technical details.  I hope this helps someone else with the same problem so they won’t waste the time that I did.

3 comments:

rsobol@hilightsinc.com said...

Incredible. I would of never got that fixed without your post.
I am on a mission to add Invoices to my QBooks 2011 from eith Microsoft Access application (preferred option) or from a C# application sitting between the two.

Any suggestions.

Txs, Rob
rsobol@hilightsinc.com

SS said...

C# for sure.

xcod4r said...

Shutdown or restart

Leave a Reply