程序配置
配置和优化应用程序
config文件
<starup> 只包含<requiredRuntime>,该元素允许指定使用的公共语言运行库的版本
<runtime> 程序集邦定和垃圾回收的行为
<system.runtime.remoting> 有关信道和远程对象的配置
<system.net> Internet应用程序的信息
<mscorlib> 包含<cryptographySetting>元素,配置应用程序使用密码的方法
<configSections> 自定义配置
<system.diagnostics> Trace和Debug的配置
使用动态属性配置
DynamicProperties节点
获取动态属性设置
System.Configuration.AppSettingsReader
优化
避免后期绑定
避免使用全局变量
小心使用循环
测试性能
perfmon.exe
启用编译器优化
Configuration Properties -> Build -> Enable Optimizations 或 Optimize Code = true 会变得难以调试