Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've got an ArcGIS Engine application that uses the IMADtedLayer interface to access VPF DTED catalog layers and adds them to a map. The code ran fine under v9.3.1. I just updated to v10, and now I get:

Unable to cast COM object of type 'ESRI.ArcGIS.DefenseSolutions.MADtedLayerClass' to interface type 'ESRI.ArcGIS.DefenseSolutions.IMADtedLayer'. ... No such interface supported

Here's the relevant C# code:

// geodbFWS is the IFeatureWorkspace object that contains the catalog
// sCatName is the catalog name (string)
ITable catTable = geodbFWS.OpenTable(sCatName);

if (catTable != null)
{
    IMADtedLayer aMADted = new MADtedLayerClass();
    bool bSetup = aMADted.Setup(catTable);
}

The error occurs on the "bool bsetup" line.

I've tried substituting new MADtedLayer(); for new MADtedLayerClass(); - with the same result. I've also uninstalled all ArcGIS components, cleaned out the registry and re-installed. I get the same error.

I'm using MSVisualStudio 2010, and the intellisense recognizes the IMADtedLayer interface, the MADtedLayerClass, and the .Setup method - as well as the fact that it should return a boolean.

I'm running the Windows 7 Professional Operating System. Has anyone else encountered this problem? Any insights will be greatly appreciated!

share|improve this question
    
I'm working with Mark on this project, and I'll add that this code runs without exceptions on 2 other development machines. –  Keith G Feb 11 '11 at 20:36
    
I have a new thought. In looking at the GAC, the ERSI.ArcGIS.DefenseSolutions assembly is listed with a processor architecture of MSIL. Nearly all of the other ESRI assemblies are x86. We are developing on 64-bit systems (Win 7) with platform target set to x86 and target framework 4.0. I know there are some compatibility issues with .Net 4 and ESRI objects: ESRI references must be included with 'embed interop types' to false ... So I'm wondering if it may be related to some incompatibility between the MSIL assembly and the x86/.NET 4/64-bit combination. –  Keith G Feb 23 '11 at 16:58

2 Answers 2

I've usually encountered problems like this when either the Military Analyst extension installation is corrupted. When you uninstalled ArcGIS, did you uninstall MA before uninstalling ArcGIS? Also, did you get the latest version from http://www.esri.com/software/arcgis/defense-solutions/download-ma.html?

share|improve this answer
    
Tried this an still getting the same results. Note that I was able to reproduce this problem on another machine. Coincidentally, it occurs on 2 different laptops but works on 2 different desktops. –  Keith G Feb 23 '11 at 16:52

I found a workaround for this problem, but I'm not sure we've fully identified the cause.

We were running this code in a unit test following the upgrade from ArcGIS 9.3 to 10.0. It worked prior to the upgrade, but not after. That's how the problem was initially identified.

Eventually, I ran this code outside of the unit test, and it worked. Further investigation indicated that it only fails when run inside an nUnit unit test. It works fine using Microsoft's unit test framework. So we will run this test without nUnit.

It's idle speculation on my part, but I'm wondering if there is something either related to one of ... threading, licensing, underlying COM objects, or 64-bit operating system.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.