Re: Debugging problems: Unable to attach to process - General - Support Forums - CodeSmith Community
Welcome to the CodeSmith Community!

Re: Debugging problems: Unable to attach to process

Support Forums

A description has not yet been added to this group.

Debugging problems: Unable to attach to process

  • rated by 0 users
  • This post has 8 Replies |
  • 3 Followers
  • I am using CodeSmith 3.2.7 and have the following problem:

    I set a breakpoint in a template using Debugger.Break(); and have Debug="True" in the template directive at the top of the file. When I execute the template, I get the dialog box that pops up asking me about debugging, only I get the following as my choices:

    New instance of Microsoft CLR Debugger 2003
    New instance of Visual Studio .NET 2003

    I expected, since I have it installed and am using 2.0 stuff, that I would have seen Visual Studio 2005 in that list. I don't, and that is the main issue I am having - if I choose either of those in the list, I get an error once the debugger has opened, of course: Unable to attach to the process.

    So, anyone know how I can get the 2.0/2005 stuff to show up in that list? What gives? This really sucks and I need to debug.

     

    j a s o n   b u n t i n g
  • Hey Jason,

    I've seen this happen when you have side by side installs of CodeSmith.  You might have upgraded to 3.2.7, but may still have 3.1 on your machine, and could potentially still be the default instance of CS.  If this is not the case, the only other thing I can think of is to check out the assemblies and pdb's that get created and ensure they are 2.0 assemblies.

    You can find those assemblies in:
    C:\Documents and Settings\All Users\Application Data\CodeSmith\v3.X\Template Cache


    Robert Hinojosa
    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams
    http://www.nettiers.com
    -------------------------------------

  • Well, I assume the assemblies I am creating are 2.0 because I added some generics and was able to compile them from with CodeSmith Studio... Is that a bad assumption?

    I think I did the upgrade (can't recall, to be honest), how can I get this fixed?

    Thanks, it would be nice to get beyond this problem!

     

    j a s o n   b u n t i n g
  • Sorry, hadn't noticed your post.  Yes, that would be a valid assumption, and would also mean that the compiler is working correctly. 

    So, now for the nitty gritty.  It's possible that your JIT Debugger is disabled for VS2005.  It requires COM+ permissions.  To test it out, prop open VS2005 or Snippet Compiler, or similar.

    Write a small program to invoke the debugger.

    Main(args[])
    {
      System.Diagnostics.Debugger.Break();
    }

    Compile and run the program, if it shows you the vs2005 and vs2005 CLR, then there's other issues at hand.


    Robert Hinojosa
    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams
    http://www.nettiers.com
    -------------------------------------

  • Yeah, it brings up the same dialog with on the 2003 version debuggers. I did more looking into it and got this help page:

    http://msdn2.microsoft.com/en-us/library/ssc8234s.aspx

    If you read that short entry, there is a line in it that is what I am seeing:

    Another debugger has registered itself as the Just-In-Time debugger. To repair, enable Just-In-Time debugging or run Visual Studio repair.

    I just can't seem to find anything that tells me how to "enable Just-In-Time debugging" but I think I will eventually get this working. Thanks for your help, I am close to solving this with your help.

     

    j a s o n   b u n t i n g
  • Do you by any chance install VS2003 after VS2005?

    Couple things to try next:
    From Start/Run: dcomcnfg

    Expand My Computer - > DCOM Confg -> Visual Studio Just-In-Time Debugger,
    Ensure the proper security has been set for your current policy/user.

    Check this key to make sure the correct JIT debugger is set.
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Debugger\JIT\

    Then, from that article i read, it looks like you might try repairing the VS install.  But definately do that as a last resort sort of thing. 


    Robert Hinojosa
    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams
    http://www.nettiers.com
    -------------------------------------

  • From "Visual Studio Hacks" by James Avery (O'Reilly, 2005), page 167:
    --
    "To enable JIT debugging with Windows Forms, you will need to add a configuration setting either to the app.config of your application or, if you want to enable JIT debugging for all Windows Forms applications, to the machine.config.  To enable JIT debugging, you need to add the following element inside the <configuration> element:
    <system.windows.forms jitDebugging="true" />"
    ...
    "If you want to modify the machine.config file to enable JIT debugging for all Windows Forms applications, the file can be found in the following directory:
    %SystemRoot%\Midrosoft.NET\Framework\v1.1.4322\machine.config
    The machine.config file actually already has this element -- it simply needs to be uncommented."
    --
    It goes on about the JIT settings in the registry.

    I haven't tried this.  I was just reading about it last night to see if I could work the problem I posted earlier, but have not gone back and tried it yet.  Hope it helps.

    Bill

  • Robert, I don't remember which order I installed the IDEs in, but I suppose it is possible I installed 2003 after 2005. Either way, I would hope that wouldn't matter too much, or at least that I should be able to easily configure which one to use for JIT debugging. Seems easy from the way they state it in the docs, "enable JIT debugging," as if it is a simple task. Messing with the registry or the machine.config are less-than-friendly ways of doing it (though not technically challenging by any means, just tedious).

    I looked at that DCOM Config section and as far as I can tell, things look okay; I am the only user on the machine (the dreaded and much-maligned running-as-administrator setup), so I didn't really think permissions were an issue, but it was a good recommendation nonetheless.

    As for the registry, the Host Path setting is:

    C:\WINDOWS\system32\vsjitdebugger.exe

    The settings for both ".NET Debugger" and "Native Debugger" both reference the same path, albeit with parameter strings, etc. What am I looking for, exactly?

    I appreciate the help!

    j a s o n   b u n t i n g
  • Bill,

    I appreciate your taking time to help out, and I have seen this mentioned elsewhere - before I try it, I am curious as to what else I can find out about this. It amazes me, yet doesn't at the same time, that this is such a pain - you would think toggling between the two versions would be something many people want to do and that this would be at least fairly common knowledge. But, this is Microsoft software after all . . . . :P

    If I get desperate enough, maybe I will mess with this. At this point, I just don't feel that it is the solution. But then, what do I know?

    Thanks,

    j a s o n   b u n t i n g
Page 1 of 1 (9 items)