I developed a custom tool for ArcGIS Desktop (implementing IGPFunction). Now this seems to works fine, the only problem is that I cannot debug the Execute() method. The actual execution works, but a breakpoint that I set inside the method is never hit. The only workaround I found so far is to put System.Diagnostics.Debugger.Break(); inside the Execute method: This will fire up a 2nd instance of Visual Studio, in which I can debug properly.
I was wondering if there's an easier way to do this.
This is just what I was looking for but it did not work for me. I am using 10.1 and have created custom geoprocessing tools that depend on a second dll. It would be great to debug this but it is impossible to get a break point to hit.
Any help would be great.
As a second question, the dll actually loads when I call it in the main thread but there is no evidence that it loads in the execution thread. Very strange.
I've found that inserting the following code into your solution will help with debugging custom GPFunctions. This line will prompt you to start a session of Visual Studio and allow you to step through your code.
I just used this the other week against a custom GP function I built and place the code within its execution method.