Project Settings and Project Structure
-
Always build your projects with Warning Level 4 (see Figure E-1).
-
Treat warnings as errors in the Release build (note that this is not the default of Visual Studio). Although it is optional, this standard recommends treating warnings as errors in Debug builds as well.
-
Avoid suppressing specific compiler warnings.
-
Avoid explicit custom version redirection and binding to CLR assemblies.
-
Avoid explicit preprocessor definitions (#define). Use the project settings for defining conditional compilation constants.
-
Do not put any logic inside AssemblyInfo.cs.
-
Do not put any assembly attributes in any file other than AssemblyInfo.cs.
-
Populate all fields in AssemblyInfo.cs, such as company name, description, and copyright notice.
-
All assembly references should use relative paths.
-
Disallow cyclic references between assemblies.
-
Avoid multi-module assemblies.
-
Avoid tampering with exception handling using the Exception window (Debug
Exceptions).
-
Strive to use uniform version numbers on all assemblies and clients in the same logical application (typically, a solution). Use the SolutionInfo.cs technique from Chapter 5 to automate.
-
Name your Visual Studio 2005 application configuration file App.config, and include it in the project.
-
Modify the Visual Studio 2005 default project structure to your project's standard layout, and apply a uniform structure for project folders and files.
-
A release build should contain debug symbols (see Figure E-2).
Figure E-2. The Advanced Build Settings dialog
-
Always sign your assemblies, including the client applications.
-
Use password-protected keys.
本文提供了一系列项目构建的最佳实践建议,包括使用警告级别4进行构建、将警告视为错误、避免特定编译器警告的抑制等。此外,还推荐了统一版本号、配置文件的命名规范、项目结构的标准化等内容。
1693

被折叠的 条评论
为什么被折叠?



