none
Stepping into WPF Source RRS feed

  • Question

  •  


    Hi

     

    I’m trying to step into a TextBox Control constructor without success (although symbols look fine).
    var aTextBox = new TextBox(); // F11

    I’m getting:

    'C:\Windows\Microsoft.Net\assembly\GAC_32\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll', Symbols loaded.
    'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll', Symbols loaded


    --
    --

    Step into: Stepping over method without symbols 'System.Windows.Controls.TextBox.TextBox'

    --
    --

    Here is my setup

    Win7/SP1 (64bit) (All latest patches) + VS2010 SP1Rel.

    System Variable:

    _NT_SYMBOL_PATH=SRV*E:\SymbolCache*http://referencesource.microsoft.com/symbols


    Debugging Configuration:

    Automatically load symbols for: all modules

    Symbol location (Order)

    1. Environment variable _NT_SYMBOL_PATH
    2. Microsoft Symbol Servers


    UNCHECK: Enable Just My Code
    UNCHECK Step over properties and operators
    CHECK: Enable .NET Framework source stepping
    CHECK: Enable source server support
    CHECK: Print source server diagnostics

     
    Update:

    Also tried CHECK/UNCHECK Require source files to exactly match the original version


    Anyone knows what’s the problem ?

    Thanks!

    -Itai



    • Edited by itaimc Monday, October 10, 2011 1:42 PM
    Monday, October 10, 2011 1:05 PM

Answers

  • http://blogs.msdn.com/b/rscc/archive/2010/08/16/net-framework-4-reference-source-is-available.aspx

    The .NET 4 file version for this release is 4.0.30319.1.

    We can see that the Reference Source for .Net Framework released is for 4.0.30319.1 version. But there're assembly libraries were upgraded while the others were not and stay in 4.0.30319.1. "Unfortunately", the PresentationFramework.dll assembly has been upgrade to 4.0.30319.233. But there's no Reference Source for this version of the .Net Framework.

    It is the KB2468871 updated the PresentationFramework.dll assembly to the 4.0.30319.233 version: http://support.microsoft.com/kb/2468871.

    So you can not step into the source code in PresentationFramework.dll assembly, the pdb released is 4.0.30319.1 version from Microsoft web site, but we want is the new version 4.0.30319.233 pdb for the Visual Studio 2010 debugging.

    So I mentioned Reflector tool, or just view the source code download form the Reference Source web site form Microsoft.

    Or maybe you can try to uninstall that update form your environment, but I'm not sure if this can be done and safety enough for your System, I don't recommend you to use this option to solve your requirement, just want step into the source code form Visual Studio 2010.

    I also have an method can let we use the 4.0.30319.1 version PresentationFramework.dll with the current available version pdb and source code file to let you debug into the .Net Framework source code. But maybe it is not very good enough for your project's stability, since we use one version assembly to debug and test, but with another new version to released the product, maybe there's some places changed in the new version assembly. But I think for learning and practice, this way is the best I can think out in free way.

    steps:

    1. Backup the PresentationFramework.dll file in "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35", since the Visual Studio will load .Net Framework libraries form this directory, instead of the "Path" property of the reference file in the Visual Studio Solution Explorer.

    2. Copy a 4.0.30319.1 version PresentationFramework.dll to the above folder, so that we can let the Visual Studio load the 4.0.30319.1 version library as we expected. (You can find this version PresentationFramework.dll from other Systems or some others web site.)

    3. "E:\ReferenceSource\Symbols\SymbolCache\MicrosoftPublicSymbols\PresentationFramework.pdb\59A23BC640434D6795738671BA67F1261\PresentationFramework.pdb: Symbols loaded."(This is my environment, I think you need to find yours from the Modules Window at last time you tried to debug into the .Net Framework source code.)We can find the Symbol loaded form this path from the "Modules" Window when we debug and hit a break point in WPF project, then we need to do is go to that directory and delete the "PresentationFramework.pdb\59A23BC640434D6795738671BA67F1261" directory. This is important to find the Symbols cache and delete them form your disk, so that it will download the correct 4.0.30319.1 version pdb for you.

    4. Then we have the old version PresentationFramework.dll file in "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35", and no PresentationFramework.pdb information in the Symbol cache directory.

    5. Ensure you have checked the "Enable .Net Framework Source stepping" option. To know how to step into the source code, you can ref this article.

    6. And then you can press "F5" to debug your project and step into the .Net Framework source code again.

    Please do not forget to recover this "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35" folder content to your new version PresentationFramework.dll assembly which I asked you make a back up.

     

    Have a good day!

    http://mikedoszhang.blogspot.com/2011/10/visual-studio-debugger-net-framework.html


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.




    Wednesday, October 12, 2011 4:28 PM
    Moderator
  • The pdb for System.Drawing.dll I used yesterday, was fresh from the reference-server as far as I can judge (renamed cache-directory). (Like the one just a couple of minutes ago).
    So this is just guessing.
    Is there a stale reference, (first position), lying around for normal 'Microsoft Symbol Servers', probably in 'Debugging Options'? My normal settings there:
    first position checked 'Environment Variable: _NT_SYMBOL_PATH' pointing to normal 'Microsoft Symbol Servers',

    unchecked 'Microsoft Symbol Servers',

    checked 'http://referencesource.microsoft.com/symbols',

    'Cache symbols in this directory' only directory name.

    Though I tried yesterday exclusively setting _NT_SYMBOL_PATH
    (both for user and system) with success (there only private symbols got loaded).
    Strange.

    With kind regards


    • Edited by MaybeCompletelyW Thursday, October 13, 2011 7:19 AM
    • Marked as answer by itaimc Thursday, October 13, 2011 7:50 AM
    Thursday, October 13, 2011 7:18 AM
  • Your theory proved right and it appears there is some VS stale reference bug hiding underneath.

    As mentioned previously, my symbol file locations setup are:

    1. Environment Variable: _NT_SYMBOL_PATH (Checked)
    2. Microsoft Symbol Servers (Unchecked)

    I restarted VS -> Emptied the Symbol Cache (Button Press) -> Confirmed that the directory is empty in explorer -> Checked + Unchecked the Microsoft Symbol Servers checkbox -> Pressed OK > Started Debugging.


    Now VS downloads the correct file :)


    As far as debugging into PresentationFramework.dll, I can only wish that MS will cont. to keep the source ref in sync with latest releases…

    Meanwhile, I think the best approach for me is to prepare a VS “Release” VM (with Windows update turned off) and use it for investigation purposes, that way I can expect exact snapshot of the source without running into potential sync issues.

    Thank you both very much!

    -Itai


    itai
    • Marked as answer by itaimc Thursday, October 13, 2011 7:50 AM
    Thursday, October 13, 2011 7:50 AM

All replies

  • Unsure. Could be, that the new sources are still not available.
    Reference source for Visual Studio 2010 SP1
    http://social.msdn.microsoft.com/Forums/en-US/refsourceserver/thread/41388c7b-582b-4e3f-8178-3d38a3c99639
    and you got only stripped (public) pdbs.

    With kind regards

    Note: You may use dbh.exe to test, if pdb-files are private or public (besides private pdbs are much bigger).
    Also you should take into account, (if the new files should be available?) when stripped pdbs are stored in your local symbol-cache, they will be used by VS, instead loading the ones with source-info.


    Monday, October 10, 2011 6:42 PM
  • Hmm.. I would expect the sources to be updated after 6 month …

    Actually I tried to step into other class (e.g threading) and had no luck.

    I deleted the Symbol Cache and let VS download from start but that didn’t help

    The presentation core pdb file is around 2MB

    Do you know on top of your head a short syntax for verifying this with dbh ?

    Thanks,

    -Itai


    itai
    Monday, October 10, 2011 8:44 PM
  • For private-pdb dbh should give
    dbh -v C:\SymbolsNet\System.Core.pdb\0120952736EB40198F726EB55A81AB5E1\System.Core.pdb
    verbose mode on.
    DBGHELP: System.Core - private symbols & lines
    ...
    (you may quit dbh interactive through 'q')
    My last try with ref server (sept 11): simple winform-app, I got only for 'old' version 4.0.30319.1 (System.Drawing.dll) full symbols and source 'Rectangle.cs', stepping into:  rect.Width = 200; . (Vista32)Other (newer ones) were stripped, if I remember right.
    Sorry, I have no official info.

    With kind regards




    Monday, October 10, 2011 9:44 PM
  • It seems that you will need to use the Reflector add-in in Visual Studio to help you reflect the presentionFramework.dll file, and then step into it, but it seems that you need to pay for Reflector to use this function, if you also want debug into the code.

    But I think you can use the source code viewer function to view the source code by the Reflector, this function is free. For review the code, you also can download the source code from Microsoft: http://referencesource.microsoft.com/netframework.aspx.


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
    Tuesday, October 11, 2011 2:59 PM
    Moderator
  • Hmm.. I can't step into any other .net source code as well.

    Apparently, I'm using public symbols.

    E:\SymbolCache\MicrosoftPublicSymbols\System.Core.pdb\47E3C3D41B574018BE9F0AADF82A896B1>dbh -v System.Core.pdb verbose mode on
    verbose mode on.
    DBGHELP: System.Core - public symbols
             System.Core.pdb - unmatched

     

    This is the exact _NT_SYMBOL_PATH variable value: SRV*E:\SymbolCache*http://referencesource.microsoft.com/symbols

    I deleted this folder several times to let VS download the appropriate assemblies...

    I also configured VS to use only on the _NT_SYMBOL_PATH as a location, which resulted with following direcotry structure

      Directory of E:\SymbolCache

    10/11/2011  06:00 PM    <DIR>          .
    10/11/2011  06:00 PM    <DIR>          ..
    10/11/2011  06:01 PM    <DIR>          MicrosoftPublicSymbols
    10/11/2011  06:00 PM                 0 pingme.txt
    10/11/2011  06:00 PM    <DIR>          PresentationFramework.Aero.pdb
    10/11/2011  06:00 PM    <DIR>          System.Configuration.pdb
                   1 File(s)              0 bytes

     

     

     

     


    itai
    Tuesday, October 11, 2011 4:05 PM
  • In my experience, the ref server will deliver public symbols, when the private ones are not available. (As far as I can see your settings are correct).
    And this is an indication, that even if you download offline packages of symbols, you will not be able to step into source. If the versions do not fit, there is no chance (VS is very picky in this respect).

    With kind regards

    Tuesday, October 11, 2011 5:33 PM
  • http://blogs.msdn.com/b/rscc/archive/2010/08/16/net-framework-4-reference-source-is-available.aspx

    The .NET 4 file version for this release is 4.0.30319.1.

    We can see that the Reference Source for .Net Framework released is for 4.0.30319.1 version. But there're assembly libraries were upgraded while the others were not and stay in 4.0.30319.1. "Unfortunately", the PresentationFramework.dll assembly has been upgrade to 4.0.30319.233. But there's no Reference Source for this version of the .Net Framework.

    It is the KB2468871 updated the PresentationFramework.dll assembly to the 4.0.30319.233 version: http://support.microsoft.com/kb/2468871.

    So you can not step into the source code in PresentationFramework.dll assembly, the pdb released is 4.0.30319.1 version from Microsoft web site, but we want is the new version 4.0.30319.233 pdb for the Visual Studio 2010 debugging.

    So I mentioned Reflector tool, or just view the source code download form the Reference Source web site form Microsoft.

    Or maybe you can try to uninstall that update form your environment, but I'm not sure if this can be done and safety enough for your System, I don't recommend you to use this option to solve your requirement, just want step into the source code form Visual Studio 2010.

    I also have an method can let we use the 4.0.30319.1 version PresentationFramework.dll with the current available version pdb and source code file to let you debug into the .Net Framework source code. But maybe it is not very good enough for your project's stability, since we use one version assembly to debug and test, but with another new version to released the product, maybe there's some places changed in the new version assembly. But I think for learning and practice, this way is the best I can think out in free way.

    steps:

    1. Backup the PresentationFramework.dll file in "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35", since the Visual Studio will load .Net Framework libraries form this directory, instead of the "Path" property of the reference file in the Visual Studio Solution Explorer.

    2. Copy a 4.0.30319.1 version PresentationFramework.dll to the above folder, so that we can let the Visual Studio load the 4.0.30319.1 version library as we expected. (You can find this version PresentationFramework.dll from other Systems or some others web site.)

    3. "E:\ReferenceSource\Symbols\SymbolCache\MicrosoftPublicSymbols\PresentationFramework.pdb\59A23BC640434D6795738671BA67F1261\PresentationFramework.pdb: Symbols loaded."(This is my environment, I think you need to find yours from the Modules Window at last time you tried to debug into the .Net Framework source code.)We can find the Symbol loaded form this path from the "Modules" Window when we debug and hit a break point in WPF project, then we need to do is go to that directory and delete the "PresentationFramework.pdb\59A23BC640434D6795738671BA67F1261" directory. This is important to find the Symbols cache and delete them form your disk, so that it will download the correct 4.0.30319.1 version pdb for you.

    4. Then we have the old version PresentationFramework.dll file in "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35", and no PresentationFramework.pdb information in the Symbol cache directory.

    5. Ensure you have checked the "Enable .Net Framework Source stepping" option. To know how to step into the source code, you can ref this article.

    6. And then you can press "F5" to debug your project and step into the .Net Framework source code again.

    Please do not forget to recover this "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35" folder content to your new version PresentationFramework.dll assembly which I asked you make a back up.

     

    Have a good day!

    http://mikedoszhang.blogspot.com/2011/10/visual-studio-debugger-net-framework.html


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.




    Wednesday, October 12, 2011 4:28 PM
    Moderator
  • MaybeCompletelyW /Mike  Thanks.

     

    Unfortunately, stepping into "original" .net source fails as well.

     

    Here is my attempt to F11 into the Point class

    System.Drawing.Point p = new System.Drawing.Point(1, 1); 

     

    Output Window:
    --------------

    'SourceTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Symbols loaded.

    ..
    ..

    'SourceTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'E:\___WPF\WPF-Test\SourceTest\bin\Debug\SourceTest.exe', Symbols loaded.

    ..
    ..

    Step into: Stepping over method without symbols 'System.Drawing.Point.Point'


    Modules Window
    ------------------

    System.Drawing.dll 
    C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll 
    Yes 
    N/A 
    Symbols loaded. 
    E:\SymbolCache\MicrosoftPublicSymbols\System.Drawing.pdb\DB478858AD4F41F0B9B231ECEC0356431\System.Drawing.pdb 

    4.0.30319.1 built by: RTMRel 
    3/18/2010 10:12 AM 
    6E260000-6E3F6000 
    [1116] SourceTest.vshost.exe: Managed (v4.0.30319)


    Symbol Load Setting
    -----------------------

    C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.pdb: Cannot find or open the PDB file.
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\System.Drawing.pdb: Cannot find or open the PDB file.
    E:\SymbolCache\MicrosoftPublicSymbols\System.Drawing.pdb\DB478858AD4F41F0B9B231ECEC0356431\System.Drawing.pdb: Symbols loaded. 


    itai
    Wednesday, October 12, 2011 7:33 PM
  • Also...

    System.Drawing.Font a = new System.Drawing.Font("Arial",12.0F);

    ...

    Step into: Stepping over method without symbols 'System.Drawing.Font.Font'


    itai
    Wednesday, October 12, 2011 7:43 PM
  • Just tested stepping into
    p = new System.Drawing.Point(1, 1);
    System.Drawing.Font a = new System.Drawing.Font("Arial",12.0F);
    'Point.cs' and 'Font.cs' got loaded. (Vista32) 
    System.Drawing.dll
    C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll 
    Yes 
    N/A 
    Symbols loaded. 
    C:\symbols\msnew2\System.Drawing.pdb\DB478858AD4F41F0B9B231ECEC0356431\System.Drawing.pdb

    4.0.30319.1
    built by: RTMRel 
    18.03.2010 10:12 
    68400000-68596000 
    [1324] SourceServer.exe: Managed (v4.0.30319)
    PDB is 1.398 KB
    Debugging without hosting process. Symbol-Server copied from your post.
    'Require source files to exactly match original version' is unchecked.
    So now I am really running out of ideas.

    With kind regards



    Wednesday, October 12, 2011 9:34 PM
  • A-ha.. :)  Your pdb file size hinted me to check my file size and indeed the one VS downloaded from the reference source url is 123 KB.
     
    I manually copied the pdb file from the reference source “src\Symbols” directory to the SymbolCache directory and now it works…

    \src\Symbols\system.drawing.pdb\DB478858AD4F41F0B9B231ECEC0356431

    \SymbolCache\MicrosoftPublicSymbols\System.Drawing.pdb\DB478858AD4F41F0B9B231ECEC0356431

    Seems like the pdb file(s) in the reference URL are either out of sink or VS does not download the right files for some reason…

    Maybe due that I'm running Win7 64bit ...


    itai
    Wednesday, October 12, 2011 11:23 PM
  • Could you please backup and rename your symbol directory and attempt to have VS download the file on demand ?

    Best regards,

    -Itai


    itai
    Wednesday, October 12, 2011 11:29 PM
  • The pdb for System.Drawing.dll I used yesterday, was fresh from the reference-server as far as I can judge (renamed cache-directory). (Like the one just a couple of minutes ago).
    So this is just guessing.
    Is there a stale reference, (first position), lying around for normal 'Microsoft Symbol Servers', probably in 'Debugging Options'? My normal settings there:
    first position checked 'Environment Variable: _NT_SYMBOL_PATH' pointing to normal 'Microsoft Symbol Servers',

    unchecked 'Microsoft Symbol Servers',

    checked 'http://referencesource.microsoft.com/symbols',

    'Cache symbols in this directory' only directory name.

    Though I tried yesterday exclusively setting _NT_SYMBOL_PATH
    (both for user and system) with success (there only private symbols got loaded).
    Strange.

    With kind regards


    • Edited by MaybeCompletelyW Thursday, October 13, 2011 7:19 AM
    • Marked as answer by itaimc Thursday, October 13, 2011 7:50 AM
    Thursday, October 13, 2011 7:18 AM
  • Your theory proved right and it appears there is some VS stale reference bug hiding underneath.

    As mentioned previously, my symbol file locations setup are:

    1. Environment Variable: _NT_SYMBOL_PATH (Checked)
    2. Microsoft Symbol Servers (Unchecked)

    I restarted VS -> Emptied the Symbol Cache (Button Press) -> Confirmed that the directory is empty in explorer -> Checked + Unchecked the Microsoft Symbol Servers checkbox -> Pressed OK > Started Debugging.


    Now VS downloads the correct file :)


    As far as debugging into PresentationFramework.dll, I can only wish that MS will cont. to keep the source ref in sync with latest releases…

    Meanwhile, I think the best approach for me is to prepare a VS “Release” VM (with Windows update turned off) and use it for investigation purposes, that way I can expect exact snapshot of the source without running into potential sync issues.

    Thank you both very much!

    -Itai


    itai
    • Marked as answer by itaimc Thursday, October 13, 2011 7:50 AM
    Thursday, October 13, 2011 7:50 AM
  • You're welcome!

    Have a good day!


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, October 13, 2011 4:18 PM
    Moderator
  • For other that run in to this problem here is how I did it (VS2015):

    Downloaded and installed JetBrains dotPeek

    run dotPeek as a symbol server

    As explained here: https://www.jetbrains.com/help/decompiler/2016.1/Using_product_as_a_Symbol_Server.html

    you probably also have to delete/rename the already downloaded wrong version of PresentationFramework.pdb as explained under "Possible Problems and Solutions" in above link

    Sunday, October 30, 2016 12:03 PM