No executable code of the debugger's target code type is associated with this line

Another newbie dipping his toe into custom component development…

In the past weeks, I have been creating a custom component (about 600 lines including comments), using the C# IDE component . However, as computational features are added, I have moved to Visual Studio primarily for its debugging feature and class management. Within VS the component code compiles, the debugging symbols load, but I am not able to get past the breakpoint message as shown in the title.

Present features of the code are:

  1. As I am learning C#, I have defined all methods (functions) procedurally, and not used classes. All the methods are defined within the SolveInstance method. As soon as the debugging is working, developing with classes and instances is next on my list.
  2. The sample code provided with the Grasshopper template debugs just fine with the same project and debug settings.
  3. I am using the latest version of Rhino, and targeting .net 4.8 for compiling.
  4. The component itself can be placed within a Grasshopper file, and once the ports are hooked up, it says that the component ran once without error.
  5. The purpose of the component(s) is to generate GCode for a specialized CNC machine I am building.

Thanks much for your reply.

Hi @David_Saylor,

Try setting your project’s output path to Grasshopper’s Component’s folder:

– Dale

Hi, Dale, thanks for your prompt reply:

Because this did not result the problem, I am going to use screen grabs, and comments to reply.


Above is the VS Project\Properties adjustment. (I had changed it previously to reside on my primary partition instead of in a backup partition.)


I also adjusted the Library folder in Rhino under GrasshopperDeveloperSettings.


The Custom Component compiles and loads fine into Grasshopper. Once the ports are wired, the component ran once.


I get the same debug error message. (I am using VS2019.)

Prior to this reply, I did a clean reinstall of Rhino. Interestingly, the D:\ drive is a secondary partition on my desktop that I use for backup. I would have assumed that with a clean reinstall, Rhino would have created this \Grasshopper\Libraries file on the C:\ drive, ie, the boot drive. I also find that the Grasshopper template defaults to the C:\ drive for the start program.

C:\Program Files\Rhino 7\System\Rhino.exe Program

I am going to change pointing to the on the D:\ drive and report back. This has got me stumped.

Thanks much for your reply.
Dave

Good morning. Still stumped with this error message when debugging…

Though I assumed there might be a conflict with Rhino starting from the C:\ drive when debugging and the compiled custom component residing in the D:… Grasshopper\Libraries, my testing did not remove the error.

Therefore, in a attempt to keep everything ‘vanilla’, I have adjusted the following:
GrasshopperDeveloperSettings → C:\Users\ds463\AppData\Roaming\Grasshopper\Libraries\

StartProgram and OutputPath Settings as follows →

The compiled component loads fine, the debugger can see the .pdb file, and once the wires are attached, the component run once.

Looking at the error message more closely three options for the fault are suggested, with the last being most suspect. (There are no conditional compilation or compiler optimizations. I don’t know how to adjust compiler settings.)

Still lost in the weeds.
Thanks much for your reply.
Dave

Good afternoon… Still offering hints of my debugging error anomaly. Assuming some settings were the cause of the debug fault, I created a new solution and replaced the example code with my code in the VS solution. It compiled fine, and can be placed in a Grasshopper file. However, breakpoints work for the DA.GetData portions of the SolveInstance method, but do not stop at any code blocks of my custom code. Please see below:

By contrast, in a separate template provided example code, if I set a breakpoint at the only function call (CreateSpiral), I can step through the function definition with its loops, without issue.

Still puzzled.
Thanks much for your reply.
Dave

Hi @David_Saylor

Make sure the .pdb file, which contains the debug info is in the same location as your .gha file.

Thanks Nicholas, that was it!
My mistake was that by dragging the component.gha file onto the Grasshopper window, automatically Rhino placed it into the Grasshopper\Libraries folder and I could drag that component from the menu onto window. My dismay was that I could see that the custom component was attached and the symbols loaded in the debugger Modules window. This was a false positive.

However, without also moving the component.pdb file into the Grasshopper\Libraries folder, the VS debugger cannot truly see the debug symbols. Your recommendation was spot on!
Dave