6

First ever post to this forum,

I have a C# extension (legacy from another developer) which I am trying to debug in the ArcGIS 10 Environ (64bit machine/Windows7).

I have built the ext in "Debug" mode and have a .dll, and a .tlb file available and ready to go in the "Debug" folder of my project.

My User Account Control Settings are set on the lowest setting possible, I am wide open. This is a virtual machine.

When I run debug, and then try to "Add from File" I get a message of "No Objects Added" from this project.

Frustratingly enough, I have another extension which I wrote and I am able to fire it up and debug it. Try as I might I have not found any difference between the project set ups for either of these two extensions.

Does anyone have any suggestions?

4
  • Are you running Visual Studio as Administrator (and not just as a user with admin privs)? Commented Jul 29, 2011 at 15:05
  • You know I am unsure on this one. I will look into it.
    – AndyMan
    Commented Aug 2, 2011 at 17:50
  • I was not running the Visual Studio as Administrator, but when I ran it as Admin and not a user with privileges it still did not work.
    – AndyMan
    Commented Aug 3, 2011 at 10:21
  • One aspect of the question answered: The sample solution files were set to run in a different version of the DOT Net framework. Changing my "TestButton" to the same framework (2.0, or 3.5) enabled debugging. I still cannot get the legacy code to add any objects to the test machine.
    – AndyMan
    Commented Aug 3, 2011 at 12:22

3 Answers 3

2

Do you have access to the code?

You need to first register the COM classes created (commands, tools, etc.).

http://edndoc.esri.com/arcobjects/9.2/net/d16d98a2-40ff-4e7b-b0a9-b0c96aed7d14.htm

After you registered them in, you will be able to access anything created by the other developer inside ArcMap. I'm not sure if it works for 10, but it should.

As for debbuging the code, just open visual studio, set up the project to register for cominterop and for Visual to lauch ArcMap when you press f5.

Place a breakpoint in the desired location and you're good to go.

Check screenshots

Register for COM interop Run external program

2
  • Thanks, I appreciate the screenshots. I have ensured that the project has the check box for Com Interop "Checked". However, I am not able to step through. This is one of the two first projects I have tried in VS 2010.
    – AndyMan
    Commented Jul 29, 2011 at 15:19
  • I have reviewed the article, and attempted to use the Component Categories Registrar on the "other guys code". All of the appropriate boxes appear to be checked. To ensure I am able to debug a new command button, I made a template and put in breakpoints, checked for ComInterop (box/checked) and started up Debugging in VS2010. With no luck. Never have tried REGASM, and am unsure of how.
    – AndyMan
    Commented Jul 29, 2011 at 15:30
0

I think you should try to use the custom build events that runs the ESRI Regasm tool.

In the link below, the second from last bullet point has how to do it. Once I followed the instructions I was able to debug.

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//0001000002m2000000

3
  • Jamie, Thanks for the info. I am new to RegAsm. I tried the information outlinned in the above article and added the outlinned XML to the .csproj file. I was able to build the project and then add from file (.tlb) for the test command button I am using to run down this error. However, it just appears to install, and not behave as a .dll I am debugging
    – AndyMan
    Commented Jul 29, 2011 at 16:02
  • Sorry it did not solve your issue.
    – Jamie
    Commented Jul 29, 2011 at 20:48
  • I am still working on this, I don't know if I mentioned this, but the machine I am trying to debug this code on is a Virtual Machine. Andy
    – AndyMan
    Commented Aug 2, 2011 at 17:41
0

Another option is if you have the ArcGIS DeveloperKit installed you could use one of the projects as a template and just swap your code in there. It can be kind of tricky setting up the Component Categories Registrar code section. You can find the DeveloperKit samples usually here depending on what version or ArcGIS you are using.

C:\Program Files\ArcGIS\DeveloperKit\SamplesNET\Desktop

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.