How can we help you today? How can we help you today?

VS add-in incorrectly saying "turn off Enable Just My Code"

I'm trying to use the Reflector VS addin feature "Choose assemblies to debug" and it pops up a dialog telling me to turn of Enable Just My Code.

The thing is, that flag is already off. I wouldn't be able to step into .NET reference source otherwise.

How can I work around this issue?
scottbilas
0

Comments

11 comments

  • Clive Tong
    Hi.

    Can you please check in the GUI that the option is turned off? It's found on the tools->options dialog in Debugging/General.

    If it is off, can you tell us which version of Visual Studio you are using. In VS2008 and above we use a call into the DTE to determine the setting of the flag, and under VS2005 we look at the value of a registry setting.

    Thanks.
    Clive Tong
    0
  • scottbilas
    Yes I am quite sure the option is off. I checked the GUI to be sure.

    This is VS2008 "Team System". Version 9.0.30729.4108 QFE.
    scottbilas
    0
  • xaliger
    Same here. VS 2008 and I triplechecked I have the option off. Maybe there is other option you also need set?

    btw: I got VSIP installed.

    Reflector package is loaded correctly.
    xaliger
    0
  • Clive Tong
    Hi.

    Thank you for the feedback with regard to this bug. We haven't yet managed to reproduce it here.

    On VS2008 we are simply calling into the DTE interface to determine whether the "EnableJustMyCode" property is true or false. However, if the call fails (via an exception) we then drop back into checking the registry location Software\Microsoft\VisualStudio\8.0\AD7Metrics\Engine\{00000000-0000-0000-0000-000000000000} JustMyCodeStepping which is the place where VS2005 writes changes to the setting. Hence assuming the problem is some kind of exception while the value is being checked, a workaround (if you have VS2005 on the machine), might be to configure the Visual studio 2005 on the machine to turn off "JustMyCode". That should set the value associated with the above registry key to 0. In my experiments, the value only gets written when you ok the debugging options dialog and when you have a project open.
    Clive Tong
    0
  • scottbilas
    I loaded VS2005 and the option was enabled, so I disabled it. But it made no difference - back in VS2008 I still get the complaint.

    I tried using DTE.Properties() in a macro and I can query properties just fine EXCEPT for DTE.Properties("Debugging", "General") which is where the property is that you are querying. For that I get a TYPE_E_LIBNOTREGISTERED.

    This is obviously something wrong with my machine and not the Red Gate software. Probably some add-in. Though it would be better if the error was reported instead of catching it in a general exception handler.

    Anyway, my question becomes: how about putting an "ignore this" button on that dialog? I am absolutely sure this option is disabled, and this dialog is preventing me from testing your software. It's just a safety anyway, right?
    scottbilas
    0
  • Clive Tong
    Thanks for doing the investigation.

    We ought to be logging the failure in the Properties call and I'll open a bug report for that.

    We check the "enable just my code" property so that we can be confident that after we have generated pdb files the debugger will start stepping into the decompiled code.
    Clive Tong
    0
  • apcollison
    Every member of our development team are also having the same problem with Reflector v6.

    The 'Enable Just My Code' option is OFF on all PC's but the message box telling you to turn it off always appears.

    We are using VS2008 Professional v9.0.30729.1 SP.
    apcollison
    0
  • Clive Tong
    Hi.

    We try to access a property via COM to determine if JustMyCode is enabled; I imagine that call is failing for some reason.

    Could you try running this small piece of Visual Basic in the Macros IDE which makes the same COM calls as our code?

    Sub CheckEnableJustMyCode()
    Dim props As Properties
    props = DTE.Properties("Debugging", "General")
    Dim prop As [Property]
    prop = props.Item("EnableJustMyCode")
    Dim result
    result = prop.Value
    MsgBox(result)
    End Sub

    Thanks.
    Clive Tong
    0
  • barter
    I tried to run the small piece of code of the previous post in the macro IDE of VSNET 2005 PRO and I get a ComException with the following message :

    Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))

    The error is caught on the line :

    props = DTE.Properties("Debugging", "General")

    After a search, i ended up on the following web site which states which properties can be accessed using automation and this one is not part of them !

    http://msdn.microsoft.com/en-us/library ... 42(v=VS.80).aspx


    Francois
    barter
    0
  • Clive Tong
    Thanks for trying it, but we only use the COM method in VS2008 and above, so the macro I posted is expected to fail on VS2005.
    Clive Tong
    0
  • mineson
    I just tried the code in VS 2008 and got a similar error. I think there is a COM class that needs to be registered with regsrv32. Without that, you're scanning the registry and there are quite a few entries for a standard developer's rig.

    I have VS 2005 installed from SQL Server 2005. I ran it, disabled the option, but still had the issue in VS 2008.


    I fixed the issue by setting all "justmycode" reg keys to 0, the following were still still set to 1.
    HKEY_USERS\{MYSID}\Software\Microsoft\Microsoft SQL Server\100\Tools\Shell\AD7Metrics\Engine\{00000000-0000-0000-0000-000000000000}

    HKEY_USERS\{MYSID}\Software\Microsoft\Microsoft SQL Server\100\Tools\Shell\Debugger

    HKEY_USERS\{MYSID}\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell\Debugger

    HKEY_USERS\{MYSID}\Software\Microsoft\VisualStudio\10.0\AD7Metrics\Engine\{00000000-0000-0000-0000-000000000000}

    HKEY_USERS\{MYSID}\Software\Microsoft\VisualStudio\8.0\AD7Metrics\Engine\{00000000-0000-0000-0000-000000000000}

    HKEY_USERS\{MYSID}\Software\Microsoft\VSA\9.0\AD7Metrics\Engine\{00000000-0000-0000-0000-000000000000}


    Exception:
    System.Runtime.InteropServices.COMException (0x8002801D): Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))
    at EnvDTE80.DTE2.get_Properties(String Category, String Page)
    at MyMacros.Module1.CheckEnableJustMyCode()


    Version Info:


    Version of Reflector is 6.1.0.11
    Microsoft Visual Studio 2008
    Version 9.0.30729.1 SP
    Microsoft .NET Framework
    Version 3.5 SP1

    Installed Edition: Professional

    Microsoft Visual Basic 2008 91605-270-6286337-60423
    Microsoft Visual Basic 2008

    Microsoft Visual C# 2008 91605-270-6286337-60423
    Microsoft Visual C# 2008

    Microsoft Visual C++ 2008 91605-270-6286337-60423
    Microsoft Visual C++ 2008

    Microsoft Visual Studio 2008 Tools for Office 91605-270-6286337-60423
    Microsoft Visual Studio 2008 Tools for Office

    Microsoft Visual Studio Tools for Applications 2.0 91605-270-6286337-60423
    Microsoft Visual Studio Tools for Applications 2.0

    Microsoft Visual Web Developer 2008 91605-270-6286337-60423
    Microsoft Visual Web Developer 2008

    Crystal Reports AAJ60-G0MSA4K-68000CF
    Crystal Reports Basic for Visual Studio 2008


    Dundas Chart for ASP.NET 6.2
    Dundas Chart for ASP.NET Professional Edition v6.2

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB944899) KB944899

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947171) KB947171

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947180) KB947180

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB948127) KB948127

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB952241) KB952241

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB953256) KB953256

    Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) - ENU (KB945282) KB945282

    Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) - ENU (KB946040) KB946040

    Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) - ENU (KB946308) KB946308

    Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) - ENU (KB946344) KB946344

    Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) - ENU (KB946581) KB946581

    Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) - ENU (KB947173) KB947173


    Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) - ENU (KB947540) KB947540


    Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) - ENU (KB947789) KB947789

    Microsoft Visual Studio 2008 Professional Edition - ENU Service Pack 1 (KB945140) KB945140

    Microsoft Visual Studio 2008 Professional Edition - ENU Service Pack 1 (KB947888) KB947888

    SQL Server Analysis Services
    Microsoft SQL Server Analysis Services Designer
    Version 10.0.1600.22

    SQL Server Integration Services
    Microsoft SQL Server Integration Services Designer
    Version 10.0.1600.22 ((SQL_PreRelease).080709-1414 )

    SQL Server Reporting Services
    Microsoft SQL Server Reporting Services Designers
    Version 10.0.1600.22

    .NET Reflector
    Visual Studio add-in that integrates .NET Reflector into Visual Studio to allow you to seamlessly debug into third-party code and assemblies, even if you don't have the source code for them.
    Visit www.red-gate.com for more information.
    Copyright (c) 2009-2010 Red Gate Software Inc.
    mineson
    0

Add comment

Please sign in to leave a comment.