Author Topic: Debugging an ASR in 5.7 (VS2003, .Net 1.1)  (Read 4754 times)

Offline iboutoma

  • Jr. Member
  • **
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Debugging an ASR in 5.7 (VS2003, .Net 1.1)
« on: April 07, 2015, 02:58:44 AM »
Hi all! I'm struggling with not being able to step through or even hit any break points in a custom ASR. I have reviewed the couple of discussions on here as well as the KB article on debugging appserver rules, and still can't debug.

Here is what I've done/verified so far:
Built and imported+registered my ASR assembly using LCS Customization Assistant, set the "disable app server rule synchronization" check box in it while I was at it, then:
1. Changed identity of the Pivotal LifeCycle AppServer  in Component Services to "Interactive User"
2. Set up the project to build into the ePower\{System Name}\Assemblies folder, enabled the other debugging options in the project properties (Enable ASP debugging, enable ASP.Net debugging)
3. Set the debugging mode to Program - > start application C:\WINDOWS\system32\dllhst3g.exe and command line arguments: /ProcessID:{20248358-4A67-4FAC-B298-23CC94BC44EE} <-- this is the GUID of my Lifecycle Engine AppServer component in Component Services.

When I hit "debug" button in VS, it builds successfully and shows as attached to a process. Also, I am able to attach to the similar processes in the Debug->Processes list that show dllhst3g.exe and "T-SQL" in the type column. I've been hunting for the highest process ID in hopes of getting the "right" one.

In summary, I am able to interact with the business rule, and for instance I am able to make a change to stub away or re-enable a particular method, so I know the code runs and makes it into the system during deployment. BUT Visual Studio debugger does not hit any break-points.

I've lost a ton of hours and desperately need HELP! Please and thank you! :)

My environment:
- Server 2003 R2 32bit with 6GB+PAE
- Working remotely via RDP (Could this be my problem? I notice if there's a console-logon session, the lifecycle dllhst3g.exe processes spawn under _that_ session, not mine!)
- VS 2003
- The ASR project is referencing the Pivotal assemblies for 5.7 and .Net 1.1 references
« Last Edit: April 07, 2015, 03:00:58 AM by iboutoma »

Offline Dean Wooldridge, Jr.

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 494
  • Karma: +9/-0
  • Gender: Male
    • View Profile
Re: Debugging an ASR in 5.7 (VS2003, .Net 1.1)
« Reply #1 on: April 07, 2015, 04:56:29 PM »
When I debug ASRs I make sure I am connected to the console.  I also RDP into the server so I use this:

mstsc /admin /v:x.x.x.x

I also log in using the same username that runs the component service but I guess maybe changing to interactive user might work.

Offline iboutoma

  • Jr. Member
  • **
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Debugging an ASR in 5.7 (VS2003, .Net 1.1)
« Reply #2 on: April 12, 2015, 08:32:11 PM »
thanks Dean!

Good call on RDP connecting to the console, I've since switched to using the /admin RDP switch, but still no luck.

To recoup, I am able to pinpoint the COM+ host surrogate process that loads the ASR/dll in question using Process Monitor. I then tried doing Debug -> Attach to Process -> (choose my PID) -> check "Common Language Runtime", "Microsoft T-SQL", "Native" -> OK. This results in an error message:
"The requested attach was not completely successful. Program types successfully attached are: Microsoft T-SQL. Program types that failed to attach are: Common Language Runtime: Native:"

Just to be sure, I do observe in Process Monitor that dllhst3g.exe interacts with both {myAsrName}.dll and {myAsrName}.pdb located in the Pivotal Assemblies folder.

I'm really starting to run out of ideas with this one O_O

I am now offering a monetary bounty ($200USD) to anyone with ASR debugging experience who will walk me through to successfully hitting a breakpoint in this ASR.

Offline CarlC

  • Hero Member
  • *****
  • Posts: 267
  • Karma: +28/-5
    • View Profile
Re: Debugging an ASR in 5.7 (VS2003, .Net 1.1)
« Reply #3 on: April 14, 2015, 07:04:22 AM »
Just out of curiosity, can you attach to the dllhost rather than dllhst3g ? I though 2003 / 5.7 used this rather than dllhst3g.

I'll take a shipment of Peanut butter M&Ms if I am right

Offline iboutoma

  • Jr. Member
  • **
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Debugging an ASR in 5.7 (VS2003, .Net 1.1)
« Reply #4 on: April 27, 2015, 11:10:23 PM »
I remembered that a looong time ago, this system had RAM added and the Lifecycle Engine AppServer had the "Enable 3GB support" option checked. So I disabled it. I now see dllhost.exe instead of dllhst3g.exe.

Still can't attach to process...  :-[

Offline iboutoma

  • Jr. Member
  • **
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Debugging an ASR in 5.7 (VS2003, .Net 1.1)
« Reply #5 on: April 28, 2015, 09:54:54 PM »
Still not giving up... I have reconfigured the Lifecycle Engine AppServer COM+ app to run as the "pivotal" user. Logged in with the same; option "connect to console" enabled in RDP.

Out of ideas, poking around VS project property page for Debugging. Can anyone please confirm their working setup? Mine is set up as follows:
Enable ASP Debugging: True
Enable ASP.NET Debugging: True
Enable Unmanaged Debugging: True
SQL Debugging: True
Debug Mode: Program <-- should this be "wait to attach to process"?
Start Application: C:\WINDOWS\system32\dllhost.exe
Process ID: /ProcessID:{my LifecycleServer GUID...}

Both "start debug" and "attach to process" generate errors in the output window, similar to this:
"Unable to find sql driver "NTWDBLIB.DLL". Connections made using this driver will not be debugged.
The program '[2488] dllhost.exe: T-SQL' has exited with code 0 (0x0)."

 :o

Offline komgbu

  • Administrator
  • Full Member
  • *****
  • Posts: 17
  • Karma: +1/-0
  • Gender: Male
    • View Profile
Re: Debugging an ASR in 5.7 (VS2003, .Net 1.1)
« Reply #6 on: May 07, 2015, 03:16:26 PM »
Hi!

Attached settings works for me.
http://www.bfs-corp.com/

26 Bloomsbury Street, London WC1B 3QJ
Switchboard & Fax +44 (0) 845 057 4148

Offline gmodica

  • Jr. Member
  • **
  • Posts: 11
  • Karma: +2/-0
  • Gender: Male
  • Expert Pivotal CRM developer and admin
    • View Profile
    • Personal Web Site
Re: Debugging an ASR in 5.7 (VS2003, .Net 1.1)
« Reply #7 on: June 25, 2015, 05:53:02 AM »
Hi, this might be too late for an answer, but maybe it'll help others.

Sometimes you have to explicitly select the kind of code you want to debug as Visual Studio debugger doesn't detect it. Make sure that when you attach to the process (in the dialog box where you select the process to attach to) select "Managed Code" for the version of .Net framework you're working with.