Since the source code of the CR is not directly disclosed, we need to use some tools to snoop on its secrets.
The following tools are required to analyze the CRCs:
MS robotic studio express 2008r2, this does not need to be explained, install it to get
Reflector & filedisassembler, reflector has two roles: one is to decompile the DLL file of the CR to the C # language, and the other is to directly analyze the content of the CR, these analyses are not easy in. Filedisassembler is a plug-in of reflector to export the decompilation results to a C # project.
Visual C #2008 express or Visual Studio 2010 beta2 (recommended because vs 2010 greatly enhances the multi-thread debugging capability)
The above tools are available for free.
Source code and example Program
Microsoft. cr. Core. dll is the object we will study this time. To facilitate analysis and debugging, We need to decompile it with reflector and filedisassembler. Note: The decompiled source code may have some problems. The following describes several important changes:
1. Resource file. Delete the resource1.cs generated by reflector, create a resource file named resource1.resx, and run the Microsoft. cr. core. all strings in resx are copied to resource1.resx, and the original Microsoft. cr. core. resx
2. the initialization sequence of two static variables in Dispatcher. CS is incorrect. Put traceswitchcore statements and initialization statements at the top of the file.
Sample Code. For the sake of uniformity, I choseCode.
Decompress the sample code, use vs to create a ccrdemo project, add the decompressed code to the ccrdemo project, and then add the decompiled source code project to the solution, add a reference to the ccrdemo. If you can compile and run the ccrdemo, it indicates that our analysis environment has been built.