Debug. NET source code under VS2010

Source: Internet
Author: User

Microsoft to open source, it is time to use vs to single-step debugging into the source code. Reference Address: http://blog.csdn.net/waxgourd0/article/details/6600182

Useful articles: Https://msdn.microsoft.com/en-us/library/Cc667410.aspx

1, tools-selection-debugging-general, according to modify my frame up the place:

2. Tools-Options – Debug-symbols, follow the configuration:

Note here that you only need to add http://referencesource.microsoft.com/symbols to the location, which is generated during the compilation process, and then change the symbol cache path to the place you wish to place, where my path is d:\ DEVELOPMENT\NETMASSDOWNLOADER\SRC (I use Netmassdonloader without success, always search for a PDB file that is available for download to 0, The version of Netmassdownloader I am using is 1.6.0.0, according to the release instructions already support vs 10.0, if anyone knows how to solve please let me know, note that the path must have read and write permissions, and finally tick "all modules except excluded modules."

And then create a new WPF project, I just add a button to the interface and simply implement a button event:

[CSharp]View PlainCopyprint?
    1. Private void button1_click (object sender, RoutedEventArgs e)
    2. {
    3. MessageBox.Show ("Hello word");
    4. }
private void Button1_Click (object sender, RoutedEventArgs e)        {            MessageBox.Show ("Hello word");        }


A breakpoint is set on MessageBox.Show ("Hello word"), and the calling procedure can be observed on the call stack after it is run:

Right-click on non-gray to find out which source code you can view:

When you step into the F11, you can find code that you could not see before, and then you can trace the source code in depth:

Gray section Right click after the discovery "go to Source code" is not available, then select in the load symbol, you can view the source code, during the process of downloading the corresponding PDB:

The loading information is displayed as follows:

As shown in my previous compilation of the VS Platform Project (converted) cannot be used to go to source code, loading information as shown above, I thought it was the first two failed to find the reason for the PDB. When I build a new project compiled once, in addition to the new project can use to go to the source code, the original platform was previously compiled by the original can not use the "go to source" function of the project is also able to use this function, it appears that the above loading information and can use debug source code is not necessarily linked, Here you want the talent to answer the above meaning.

Finally MS does not have all the source code is open source, so sometimes in use there will be "no resources available" hint, at this time, if you want to view the source code, you can follow the stack hierarchy with Reflector direct view of the source code.

Debug. NET source code under VS2010

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.