DevExpress Source Compilation Summary Z

Source: Internet
Author: User
Tags visual studio 2010

This article includes the Basics (GAC, assembly strong signature, friend assembly), compilation process, registering the GAC, adding toolboxes, multilanguage support, runtime, and design-Time debugging

Source Address link: http://pan.baidu.com/s/1eQm1ZFk Password: 39QW
About compiling the source code, and then toss it too long, their own toss, to the official website toss, to Dxper toss, today, finally has an end

Compiling the EnvironmentTools: Visual Studio 2010 Source: DXperience Source code14.2.3.14339 (source has been sorted out, no changes required, solution files placed in sln\winform\ WINFORM.SLN) source structure in order to better verify the final compilation results, if you have installed the DevExpress official version, please uninstall, compile devexpress source code is not dependent on the DevExpress official version of the installation. Compile target1. Compile all WinForm related components in DevExpress 2.     It can be manually added to Toolbox 3 after compilation is complete. Drag and drop controls from the Toolbox into the form, the Design view works, and the runtime is normal.     4. Provide multi-lingual support 5. Ability to debug run-time and design-time Compilation BasicsReview the basics before you start compiling GAC1. What is gacglobalassembly cache, global assembly Cache 2.      Why registering an assembly with the GAC registered in the GAC can be shared by the entire system 3. How to register and unregister using the. NET Framework's own tools gacutilgacutil/i [Abc.dll], Register the Abc.dll file in the current directory to the GAC if you want to register more files, you can use the list file, after the DevExpress source code is compiled, the resulting file is more, you can use bulk Registration, command for Gacutil/il List.txt, where the list.txt format is as follows: DEVEXPRESS.BONUSSKINS.V13.2.DLLDEVEXPRESS.CHARTS.V13.2.CORE.DLLDEVEXPRESS.CODECONVERTER.V13.2.DL L ... One file name per line unregister is similar to registration, you can refer to the. NET Framekwork tools Help Assembly Strong Signature1. What is an assembly strong signature when the assembly is generated, a private key file is specified (the private key file is private and will not be exposed), and the compiled assembly is called a strong-signed assembly in such a way. 2. Why to use signature l to ensure that the generated assembly is unique, the strongly signed assembly has a public key, and only the assembly that is generated with a specific private key will have the public key. L prevent the Assembly from being tampered with, once strongly signed, the public key is stored inside the assembly, and when the assembly is loaded, the CLR validates the public key, and if it is illegally tampered with, the public key validation fails and throws an exception.      An unsigned assembly cannot register GAC3. How to use the signature l to generate the private key (PS: This private key is only for demonstration purposes, not the private key used in the source code) using the. NET Framework Tools Sn,sn-k MYKEY.SNK, the generated private key file is stored in the current directory mykey.snk

L View the public key first write the public key to the file

And then look at the public key
4. Specify signature in vs Specify Signature in VS at least two ways to indicate signature file path in the AssemblyInfo.cs file
Second, the "signature" tab in the project Properties bar
The above two ways to choose one, the second way after VS2005 support, now devexpress recommend the second, our source code in all of the signature in this way. 5. DevExpress Signature DevExpress Company, when releasing the product, uses the private key to strongly sign the product, and currently only knows its public key is marked as B88D1754D700E49A, if your program loads the assembly public key is b88d1754d700e49a,      It is proved that the use of devexpress is provided by the company, not by others 6. The signature in the source code before compiling the source code, we need to generate our own private key, the generated private key in the Devexpress.key file, all the projects in the solution use the signature, here can look at our public key
This means that our compiled assembly public key is marked as 94a041a7af35fb7f, and no one else can copy and tamper with it. (PS: This public key can be found in the Src\devexpress.key\key.txt file) Friend Assembly1. What is a friend assembly by default, the internal modifier is used in the assembly, and the type or member is accessible only within the assembly, which requires a friend assembly if it needs to be accessible externally as well.      [MSDN] A friend assembly is an assembly that can access the internal types and members of other assemblies, and if the assembly is specified as a friend assembly, it is no longer necessary to mark the type and members as public so that other assemblies can access them 2.      Why a Friend assembly L unit test is required, the test code runs in another assembly, but requires access to the assembly that is being tested internal member L class libraries are separated in multiple assemblies, and assemblies require mutual access to internal internal member 3. A lot of the underlying functionality in DevExpress assembly devexpress in Devexpress.data, which has many friend assemblies, opens AssemblyInfo.cs under Devexpress.data, and can clearly see its friend assemblies
That is, in these modules, you can directly access the internal type in Devexpress.data. Friend assemblies for other modules are similar to Devexpress.data. compilation Process 1. Code AcquisitionThe code has all been packaged into compressed files 2. Modify SignatureThe private key has been generated, and the project has signed with the private key, and no modification is required. If you want to use your own signature, you need to follow these steps: First, use the. NET Framework self-generated tool to generate a strong signature file with the name strongkey.snk, overwrite the file with the same name under Src\devexpress.key, open s Ln\winform\winform.sln, in the entire solution, replace all references to public key tokens and public keys where

3. compilingOpen Sln\winform\winform.sln, and then rebuild the solution Follow-up work Register GACThe following sections of the file are generated: In addition, the design folder contains assemblies that need to be designed to support, register the generated DLL files in the GAC (how to use the list for bulk registration, refer to the previous article), and register the DLLs in design. Toolbox AddOpen VS, create a new WinForm project, open the Toolbox, right-click in the Blanks, select "Add Tab" and then enter a name yourself, named "Devexpressbuild", then right-click, select "Select item" in the Pop-up dialog box to select "Browse", Then select a DevExpress DLL in the GAC, where Chartcontrol is the example, select C:\Windows\Microsoft.NET\assembly\GAC_MSIL\ Devexpress.xtracharts.v14.2.ui the DLL under the folder. When you are sure, you can see that the toolbox was added successfully as follows: the addition of other control toolboxes is similar. (PS: Here are some questions, How do you know Chartcontrol put in Devexpress.xtracharts.v13.2.ui this DLL file, about the specific control in which DLL, DevExpress comes with the document has a detailed description, please refer to) Results TestAt this point, DevExpress's compilation has been completed, the following to verify the results of the compilation. Or the above project, directly drag and drop the Chartcontrol in the Toolbox into the form, and finally see the results of their own compilation of randomly select a type, click "Finish", note that the reference list in VS has automatically referenced the required DLL for us, at the time of deployment, These DLLs need to be packaged and deployed on the client machine only. Already very close to the perfect, see below for multi-lingual support Multi-lingual supportIf you are using the installation version of DevExpress, you can download the required resource files to the official website, but we compiled it by ourselves and cannot directly use the strongly signed resource files provided by the official. This requires us to compile our own language resource files, this compilation is also very simple, because the solution is all set (if the source code compiled with its own signature, you need to copy Src\devexpress.key\strongkey.snk to dxkb_a421_ Dxperience_v14.2_ (2014-12-16) \devexpress.key\ overwrite the file with the same name, just open dxkb_a421_dxperience_v14.2_ (2014-12-16) \ Localization.sln, regenerate, generated product path is dxkb_a421_dxperience_v14.2_ (2014-12-16) \ DevExpress.Dll, if we need the control to support Chinese, then go to DEVEXPRESS.DLL\ZH-CN, register all the DLLs in the folder into the GAC to close and reopen the newly created project, on the basis of the Chartcontrol just Create a ribbon, you can see that the interface has been Chinese. Although the official provision of the rate of resources is not 100%, but at the time of operation has been basically able to meet the requirements. Source Debugging Run-Time debuggingSince the source code compiled, then debugging should not be a big problem, such as the above project, I want to run, to add a point to the chart, I want to see this point add a process Addpoint event handling code only one sentence in the DevExpress.XtraCharts.UI project ChartControl.cs file in the series attribute add breakpoint, and then debug the project, click on the "Addpoint "button to hit the breakpoint other debugs are similar processes. Design-Time DebuggingThe DevExpress control is well-supported against vs design, and it is possible to set control properties very intuitively during the design phase. If you want to know what DevExpress is doing at design time, you can debug it at design time. Design-Time debugging is not the same as run-Time debugging, where design-time debugging is actually using a vs debug vs, here we give an example, I want to see the above this Chartcontrol control at design time, click on "about" what to do first, in the project properties, select the "Debug" tab, Start Action Select "Start external program", followed by path select VS2010 Path, default to C:\Program Files (x86) \microsoft Visual Studio 10.0\common7\ide\ Devenv.exe, that is, I want to debug another vs two, add breakpoints this step breakpoint location according to their own needs, this time our breakpoints set in the DevExpress.XtraCharts.Design project in the Designers.cs file Chartco The Onabout method in the Ntroldesigner class is as follows (PS: Here are some questions, how do you know to click on "about" after entering this function, in fact, before debugging the code, need to know about the code)

Three, start debugging F5 Start debugging, this will open another VS, in this new vs Open the project, click on the form on the right side of the Chartcontrol control of the small arrow, in the pop-up interface Select "About", vs decisive Breakpoint, the following is actually officially provided in the 14.2.3 installed version of C Hartcontrol control Click "About" is not any reaction, this code is I added, but also function, pop-up dialog box is the legend of design-time debugging, note that the application is not running, this debugging method is very useful for developing custom controls Q&a Q : Drag and Drop controls in the Toolbox to Form no response or prompt for various errorsA: This is generally the case because there is no registration under the design folder in the build directory. Design.dll "As the end of the file, in order to design the control in VS, these DLLs must be registered to the GAC Q : To . Design.dll To the end of the file, at the time of deployment, need to be copied to the client machine? A: No, these DLLs are not required at run time Q : Drag and drop a control from the toolbox to Form , how to make VS automatically refer to the required DLLA: Registering a dependent DLL with the GAC Q : Do I need to hack the compiled assembly with the source code? A: No, in the project reference, in the referenced DLL file properties, Copy Local is set to True, then the files in the output directory are packaged and copied to other machines

DevExpress Source Compilation Summary Z

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.