64-bit Windows and ArcGIS
July 13th, 2007 by John Selkirk. Posted in ESRI, Software DevelopmentSo we predominantly use C# for development at TC Technology for many reasons which I will leave for a different post. During 64-bit testing though we found that it can be interesting when dealing with:
- 64-bit Windows
- ArcGIS 9.2
- .NET 2.0
at the same time. When trying to initialize AO using the following code
IAoInitialize init = new AoInitializeClass();
it fails with an error like this:
System.Runtime.InteropServices.COMException
Retrieving the COM class factory for component with CLSID {2237A429-E4AC-40D6-96A5-5B6CCF40D56B} failed due to the following error: 80040154.
We did some digging and, thankfully, someone has already figured it out. It turns out that if you build any .NET code with the ‘Any CPU’ option which is the default then ArcObjects based applications fail. This makes sense as the c++ dlls that are built for AO are 32-bit so the application/assemblies that are consuming them also need to be 32-bit.
Fixing the problem is pretty easy (although if you have a bunch of assemblies like we do tedious!).
First thing to do is select ‘Configuration Manager’ from the Solution Platforms drop down (the one with ‘Any CPU right now’):
It actually brings up the same configuration window as the Debug/Release configuration!
From the ‘Active solution platforms’ drop-down select ‘New’:
and from the resultant ‘New Solution Platform’ select x86. This is create a new configuration for x86 only. This way when it is run on a 64-bit environment the OS will know that it should be run as a 32-bit application.
9 Responses to “64-bit Windows and ArcGIS”
By J Braud on Jan 27, 2009
I am getting this same error message when running a command within the HEC-GeoHMS extension in ArcMap. I do have Visual Studio 2008. Is there any way for me to go into the HEC-GeoHMS extension’s code and make these changes myself? Or would that be up to the entity which created the extension? I am at risk of losing two weeks of work because I can’t export the final product to a file type I can use in HEC-HMS. I have no programming experience; but, pick up on things fairly quickly and am eager to learn. If I just knew how to get to the code I was looking to edit, I think I would be ok given the directions on your site. Any help?
By John Selkirk on Jan 27, 2009
What version of ArcMap are you running? 2008 is only supported in 9.3.
You need the DLL compiled for 32-bit. Perhaps talk to the vendor and ask them for a build in 32 bit.
Let me know if you need more help.
By J Braud on Jan 29, 2009
I am running ArcMap 9.3 . The problem would be with the HEC-GeoHMS extension and not ArcMap itself right? If I switched over to a different computer using a 32-bit OS, would that solve the problem?
By J Braud on Jan 29, 2009
I’d like to attack this problem on my own IF possible. I think the HEC-GeoHMS extension is a joint effort by the USACE (Us Army Corps of Engineers) and CRWR (Center for Research in Water Resources) at UT-Austin.
By J Braud on Jan 29, 2009
And sorry it took me two days to get back. I was assuming I would get an email when there was a response to my post.
By John Selkirk on Jan 29, 2009
Switching to a 32-bit computer will solve the problem if it is related to the 64-bit problem. It would be worthwhile testing it on a 32-bit machine just incase
By Enrique Triana on Feb 27, 2009
I’m getting the 80040154 error using the basin generation in GeoHMS using a 32-bit system. Any other ideas?
Thanks,
By luciano on Jun 15, 2009
I am with problems in installing arcgis8,3 in a computer of 64bits. E would like to know if somebody knows why?
By admin on Jun 15, 2009
ArcGIS 8.3 does not support the 64-bit environment. You need to be on 9.2 SP4. http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=29391