Minimize

Blog Entries

Debugging .NET Accpac Addons

Feb 24

Written by:
2/24/2011 12:00 AM  RssIcon

About a year ago, I posted information regarding issues with DEP (Data Execution Protection) and Accpac addins written in .Net. (http://www.zcg.com/Blog/tabid/152/EntryId/6/DEP-NET-Windows-and-Accpac.aspx)

While my post addressed the issue from the point of view of running the app, there is an outstanding issue of debugging this apps. Under the default situation, debugging a .Net Accpac addin that uses Accpac controls will cause the program to fail. The underlying reason for this relates to Visual Studio's use of a hosting process to run the debuggee. This process is started by launching the VSHOST32.EXE process which then launches the debuggee. The reason this generates DEP errors is that the VSHOST32.EXE process has the NXCOMPAT flag set. This turns DEP on regardless of what is set in the debuggee process binary.

To solve this problem, you need to modify the VSHOST32.EXE process. Run the EDITBIN utility on the VSHOST32.EXE file and set NXCOMPAT off. Then delete the vshost file that exists in the debug build folder and rebuild the app. This will recopy the vshost to the debug folder and DEP will be turned off during debugging.

Presto! Debugging .Net Accpac apps now works.


Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 
Minimize

Search

Minimize

Recent Entries

How we built Murphy's booking system
Murphy's web store goes Live
Problem with new Desktop Icon Protocol
Debugging .NET Accpac Addons
Registrationless COM
Moving from MS to Open Source
CEAB UBC Visit
Board of Examiners Christmas Lunch
Sage ERP Accpac 5.6 has been released
DEP, .NET, Windows and Accpac