Download. Net 4 source code

Source: Internet
Author: User
ArticleDirectory
    • Download. Net 4 source code
    • Prepare for debugging
    • Debug code
    • Review
Reason for the error in the DataGrid enumeration value update: Zhou jingen Source: blog Park release time: Read: 2287 Original article links [favorites]

OpenexpressappPreviously, the DataGrid was used as the list control. In the built-in property editing mode supported, the usage of the enumeration type was introduced. net35 is good, everything is normal, but some time ago openexpressapp was upgraded. when you edit the list control of the enumeration attribute, an error occurs. After an enumeration value is updated, the control displays an error, as shown below:

View the stack and only oneCodeAnd the rest are. net Framework internal code, read the code method, but do not understand, I think the best way is to view the code, the previous is to use reflector to view the code, but it is only static code, you can view it in vs2008. net Framework source code. Why don't I try it in vs2010? So I started to look for the net4 source code.

Download. Net 4 source code

Select. net4 download in http://referencesource.microsoft.com/netframework.aspx

Prepare for debugging

I have introduced some debugging framework code settings on the Internet. I tried it, but all of them will go to the server for download. After trying too many methods, I can perform debugging smoothly as follows:

    1. After installation, there are only two directories: source and symbols]
    2. Configure option, remove [enable just my code], and remember not to set [Enable. NET Framework source stepping] (otherwise, the PDB file will always be downloaded from the server after the permission is granted)
    3. Configure debug/symbols (set according to your own installation path)
    4. Copy the PDB to the symbols \ cache \ microsoftpublicsymbols directory. I found that the downloaded PDF file will be placed in the [microsoftpublicsymbols] Directory, so we need to copy all the PDB files in the installation path to this directory.
Debug code
    1. Run the code and start debugging,Remember, you can only set breakpoints through call stack.
    2. After step-by-step into debugging, the accident location is found
 Public  Class  Enumconverter : Ivalueconverter { Public  Object Convert ( Object Value, Type Targettype, Object Parameter, Cultureinfo Culture ){ Return  New  Enumviewmodel ((Enum ) Value). label ;} Public  Object Convertback ( Object Value, Type Targettype, Object Parameter, Cultureinfo Culture ){ Return NULL;    // This sentence is incorrect and no correct value is returned } The modification code is as follows:
 
Public ObjectConvertback (ObjectValue,TypeTargettype,ObjectParameter,CultureinfoCulture ){Return enumviewmodel. labeltoenum (value. tostring (), targettype );}
Review
    1. Multiple experiments to find the possibility
    2. Using. net source, you can easily debug and locate bugs.

 

Welcome to reprint, reprint Please note: Reprinted from Zhou jingen [http://zhoujg.cnblogs.com/]

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.