ICANN认证国际域名顶级注册机构
网站建设,域名注册,空间租用,软件销售,广告设计 域名注册,空间租用, 网站建设,东莞网页设计,域名注册,网站推广,网站开发,网页设计 网站推广,,百度推广,新浪推广,雅虎推广,网易推广 标志设计,画册设计,包装设计,VI策划,企业形象顾问 连邦软件加盟店,提供销遥行,管家婆,速达,用友ERP,诺顿等软件报价及销售 建站必读 腾达网络,上网帮助中心, 腾达为东莞等地,提供网站建设,网站推广,广告设计,软件销售等优质服务!
建站必读


 
 
当前位置:首页 -> 建站必读 -> .NET技术
IDesign C#编程规范(之四)
续之三,本文是IDesign C#编程规范的第三章。







3 项目设置和项目结构

Project Settings and Project Structure





1. 总是以4级警告建立项目(图略)。

Always build your project with warning level 4

2. 在发布版中将警告作为错误(注意这不是VS.NET的缺省设置)(图略)。

Treat warning as errors in Release build (note that this is not the default of VS.NET).

a) 虽然是可选的,本标准也推荐在调试版中将警告作为错误。

Although it is optional, this standard recommend treating warnings as errors in debug builds as well.

3. 永远不要抑制特定的编译警告(图略)。

Never suppress specific compiler warnings.

4. 总是在应用程序的配置文件中显式地说明支持的运行时版本。参见Programming .NET Components第五章。

Always explicitly state your supported runtime versions in the application configuration file. See Chapter 5 in Programming .NET Components.

<?xml version="1.0"?>

<configuration>

<startup>

<supportedRuntime version="v2.0.0.0"/>

<supportedRuntime version="v1.1.5000.0"/>

</startup>

</configuration>

5. 避免显式地自定义版本改向和绑定到CLR程序集。

Avoid explicit custom version redirection and binding to CLR assemblies.

6. 避免显式的预编译定义(#define)。使用项目设置定义条件编译常量。

Avoid explicit preprocessor definitions (#define). Use the project settings for defining conditional compilation constants.

7. 不要在AssemblyInfo.cs中放任何逻辑。

Do not put any logic inside AssemblyInfo.cs.

8. 除了在AssemblyInfo.cs,不要在任何文件中放程序集属性。

Do not put any assembly attributes in any file besides AssemblyInfo.cs.

9. 在AssemblyInfo.cs中提供所有字段,例如公司名称、描述、版权等。

Populate all fields in AssemblyInfo.cs such as company name, description, copyright notice.

10. 所有程序集应该使用相对路径引用。

All assembly references should use relative path.

11. 不允许在程序集中循环引用。

Disallow cyclic references between assemblies.

12. 避免多模块的程序集。

Avoid multi-module assemblies.

13. 缺省总是以非检查的方式运行(为了性能考虑),但是对易于溢出或下溢的操作显式使用检查模式(图略)。

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. 避免使用Exception窗口(Debug|Exceptions)篡改异常处理。

Avoid tampering with exception handling using the Exception window (Debug|Exceptions).

15. 努力对同一逻辑应用程序中(通常是一个解决方案)的所有程序集和客户端使用统一的版本号。

Strive to use uniform version numbers on all assemblies and clients in the same logical application (typically a solution).

16. Visual Studio.NET应用的配置文件命名为App.config,并将其包括在项目中。

Name your Visual Studio.NET application configuration file as App.config, and include it in the project.

17. 避免使用显式代码来排除方法(#if#endif),而是使用条件方法。

Avoid explicit code exclusion of method calls (#if...#endif). Use conditional methods instead.

public class MyClass

{

[Conditional("MySpecialCondition")]

public void MyMethod()

{}

}

18. 将VS.NET缺省的项目结构改为标准的布局,对项目文件夹和文件应用统一的结构。

Modify VS.NET default project structure to your project standard layout, and apply uniform structure for project folders and files.

19. 链接一个包含所有解决方案级信息的全局共享文件(图略)。

Link all solution-wide informati
 
 
本站关键词:
|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广||东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广||东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广||东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广||东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广||东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广||东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广||东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广||东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广||东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广||东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广||东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广||东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广||东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|东莞连邦软件|网页设计公司|东莞软件销售|东莞.com域名注册|东莞.cn域名注册|东莞雅虎推广|
域名注册 | 虚拟主机 | 网站建设 | 网站推广 | 广告设计 | 帮助中心 | 软件中心 | 关于腾达
东莞市腾达信息工程有限公司      本站网络实名: 东莞网站建设
地址:东莞市新城市中心区第一国际B座610   邮编:523007
电话:0769-22026071 22026072 传真:0769-22026076 24小时服务热线:13712032014
© 2002~2005 腾达网络   版权所有