AnsweredAssumed Answered

Can´t attach VS2010 to ArcMap

Question asked by HimBromBeere on Nov 28, 2017
Latest reply on Dec 5, 2017 by HimBromBeere

I created an ITool (not an AddIn) which I embed within a toolbar (MyToolbar). The code for the entire toolbar is located within one single assembly, let´s call it MyAssembly. It´s written in C#, which compiles for .NET 3.5, x86 in debug-mode. All PDB-files are appropriately copied to my assemblies bin-folder.


Here is some short code for the toolbar:



namespace MyNamespace.Toolbars
     using System;
     using System.Runtime.InteropServices;
     using System.Collections.Generic;

     using ESRI.ArcGIS.SystemUI;
     using ESRI.ArcGIS.ADF.CATIDs;


     #region "COM GUIDs"

     public sealed class MyToolbar : IToolBarDef
          #region Component Category Registration
          static void Reg(String regKey)

          static void Unreg(String regKey)

     // ...
     // implementation for IToolbar
     // ...

Now I start ArcMap and try to attch that code to it. When I set any breakpoint, it´ll not hit, because

"no symbols have been loaded for this document".

I allready uninstalled my assembly from GAC and used esriregasm to unregister any potential previous version of the file. To do so I used this:


esriregasm.exe /p:desktop /u /s MyAssembly.dll

To re-register I have some post-processing within my VS-project that calls esriregasm again


<Target Name="AfterBuild">
<Exec WorkingDirectory="$(CommonProgramFiles)\ArcGIS\bin" Command="esriRegasm.exe &quot;$(TargetPath)&quot; /p:Desktop /s" />

I also re-started VS and my computer as well, cleaned my solution and rebuilt it (which is the standard procedure for this problem when attaching any .NET-code to a program), however I still can´t break into the code.


Another possibly related issue to this is, that I can´t put my toolbar into ArcMap. As soon as I add the toolbar via RightClick --> MyToolbar, ArcMap crashes without any error-message, not even in its log-file.