Idesign C # Programming Specification (Tour)

zhaozj2021-02-16  51

Continued three, this article is the third chapter of the Idesign C # programming specification.

3 Project Settings and Project Structure Project Settings and Project Structure

1. Always establish a project (Figure for 4 warnings. Always Build Your Project with Warning Level 4 2. Warning as an error in the publishing version (Note that this is not the default setting of VS.NET) (Figure 5). Treat Warning As Errors in Release Build (Note That Is Not The Default of vs.NET). A) Although this standard is also recommended to warn as an error in the debug version. Althoughard Recommend Treating Warnings as Well. 3. Never suppress specific compilation warnings (images). Never Suppress Specific Compiler Warnings. 4. Always explicitly explain the supported runtime versions in the application's configuration file. See Chapter 5 of Programming .NET Components. Always Explicitly State Your Supported Runtime Versions In The Application Configuration File. See Chapter 5 in Programming .Net Components.

5. Avoid explicitly customize the version and rebound to the CLR assembly. Avoid Explicit Custom Version Redirection and Binding To CLR Assemblies. 6. Avoid explicit precompiled definitions (#define). Use the project settings to define the compilation constant. Avoid Explicit Preprocessor Definitions (#define). Use the project setting constants. 7. Do not put any logic in AssemblyInfo.cs. Do Not Put Any Logic Inside AssemblyInfo.cs. 8. In addition to AssemblyInfo.cs, do not place the assembly properties in any file. DO NOT PUT ANY Assembly Attributes in Any File Besides AssemblyInfo.cs. 9. All fields are available in AssemblyInfo.cs, such as company name, description, copyright, etc. Populate All Fields In AssemblyInfo.cs Such As Company Name, Description, Copyright Notice. 10. All assemblies should use relative path references. All assembly reference. 11. Not allowed to recruit in the program centralized cycle. Disallow Cyclic References Between assembly. 12. Avoid multi-module assemblies. Avoid Multi-module assemblies. 13. The default is always run in a non-inspected manner (for performance consideration), but the detection mode (Diagram) is explicitly used for easy overflow or overflow. Always run code unchecked by default (for performance sake), but explicitly in checked mode for overflow or underflow prone operations int CalcPower (int number, int power) {int result = 1;. For (int count = 1; count <= power COUNT ) {Checked {result * = number;}} Return Result;} 14. Avoid using an Exception window (debug | exceptions) tampering out. Avoid Tampering with Exception Handling Using The Exception Window (Debug | Exceptions). 15. Try to use all assemblies and clients that are in the same logical application (usually a solution) and clients using a unified version number. Strive To Use Uniform Version NumBers on All Assembly (Typical A Solution). 16. Visual Studio.net Applicate configuration file named App.config and includes it in the project.

Name Your Visual Studio.NET Application Configuration File As App.config, and INCLUDE IT IN The Project. 17. Avoid using explicit code to troubleshoot the method (# IF # ENDIF), but the conditional method. Avoid Explicit Code Exclusion of Method Calls (#if ... # Endif). Use Cands Myclass {[Conditional ("MySpecialcondition")] public void mymethod () {}} 18. By default vs.net The project structure is changed to a standard layout, a unified structure for project folders and file applications. Modify VS.NET Default Project Structure To your Project Standard Layout, And Apply Uniform Structure for Project Folders and Files. 19. Links a global shared file containing all solution-level information (images). Link All Solution-Wide Information To A Global Shared File: 20. Table is selected to use 3 space instead of tab. INSERT SPACES for Tabs. Use 3 Spaces INSTEAD OF TABS. A) Set Tools | Options | TEXT Editor | C # | Tabs21. The publishing version should contain debug symbols in the publishing version. Release build stay contain debug symbols. 22. Always sign the program set, including client applications. Always Sign Your assemblys. 23. Always use the project's SNK file to sign the interoperability assembly (Figure). Always Sign Interop Assemblies with The Project's Snk File

转载请注明原文地址:https://www.9cbs.com/read-17775.html

New Post(0)