Attaching the debugger - SmartPlant Foundation - IM Update 44 - Customization & Programming - Hexagon

SmartPlant Foundation Customization

Language
English
Product
SmartPlant Foundation
Search by Category
Customization & Programming
SmartPlant Foundation / SDx Version
10

Now you need to start the SmartPlant Foundation Desktop Client and log in. This will cause the server to be reinitialized; the server assemblies will be loaded along with our custom assembly.

After any changes, or even the first time you need to force recompilation of the project, the best way to do this is to rebuild the assembly.

To start the debugger you need to attach to the IIS worker process, as mentioned above. This will be w3wp.exe depending on the version of IIS on the machine.

Select w3wp.exe, and then click Attach for the SPF server.

Visual Studio will start up in debug mode attached to server. Initially you may see the breakpoint with an exclamation mark (below). This is because it hasn't loaded the symbols for debug yet. The next server call will load the symbols, so right-click on an object or select a menu option to invoke this.

If the breakpoint still has an exclamation mark then something has gone wrong, Visual Studio will not be able to find any of the debug information from our custom assembly within the SmartPlant Foundation Server image.

The likely causes of this include:

  • Your assembly has not been compiled.

  • Your assembly was not loaded by the server because the configuration within the settings.xml file is not exactly correct.

  • The server has not been reset since you added the code under the breakpoint.

Check these conditions, and try again. When all is correct, Visual Studio will start in debug mode, and your breakpoint will remain active indicating that all is well.