Sage 300 How to Debug into a Business View from a Sage 300 Web Screen

Introduction

Some developers may already know how to debug into your C/C++ Accpac Business View while debugging/running your module’s Sage 300 Web Screen. But, for those who do not, this little tip is very handy.

This tip allows you to debug into your Accpac Business View (where you have the source) and from your module’s Sage 300 Web Screen.

Debugging in the IDE

You have your solution loaded in the Visual Studio IDE and when you debug, you want to debug all the way down into your C/C++ Accpac Business View.

In your solution, right-click on the Web project and select the Properties menu option:

Blog181

Click on the Web tab page and notice the Native Code checkbox at the bottom in the Debuggers section:

Blog182.png

Select this checkbox and Save the changes.

This will allow you to debug into your native C/C++ code.

Debugging in IIS

The previous section showed how you can debug into native code while debugging your web screen. But, what if you want to debug into native code while your screen is not running in debug (meaning it is running in IIS)?

Launch Visual Studio and be sure to Run as administrator

From the Debug menu, Select Attach to Process…:

Blog183.png

In the Attach to Process popup, be sure to Select the show processes from all users checkbox. Look for the w3wp.exe and Click on it.

There may be multiple w3wp.exe’s listed and it is important to select the correct one. If the user is listed as IIS APPPOOL\…, this is NOT the correct one as it is an IIS executable not running Sage 300.

Blog184

Once the correct w3wp.exe is highlighted, Click on the Select button:

Blog185.png

In the Select Code Type popup, Select the Debug these code types: option and Select the Managed (v4.6, v4.5, v4.0) and Native checkboxes and Select the OK button:

Blog186

This will allow you to debug into your native C/C++ code. 

Summary

This article explained how to debug into native C/C++ code when debugging your Web Screen solution in Visual Studio and also how to attach to an IIS process to debug into native C/C++ code if the Web Screen is running (not in debug mode).

Happy debugging.

As a standard disclaimer, any topic in this article is subject to review and doesn’t represent a commitment as to when it will be available.

 

Advertisements