1
最近用VS2008开发Windows Mobile程序,使用C#、.NET Compact Framework,发现项目生成速度比较慢。用VS2008打开项目后,开始一段时间生成速度还能忍受,时间一长,编译速度巨慢,最慢达到5分钟之久,实在无法忍受。
2
3
4
5 决定找出VS2008生成时,做了什么花费时间的工作。从工具à选项进入“选项”对话框
6
7 选择“MSBuild项目生成输出详细信息”为“诊断”这样编译时,会输出具体执行了那些任务,花费了多少时间。
8
9
10
11 结果发现最花费时间的是
12
13 Platform Verification Task
14
15
16
17 http: // blogs.msdn.com/vsdteam/archive/2006/09/15/756400.aspx有Platform Verification Task
18
19 的具体描述
20
21
22
23 参照上文的说明,修改文件
24
25 C:\Windows\Microsoft.NET\Framework\v3. 5 \Microsoft.CompactFramework.Common.targets
26
27 中
28
29 < Target
30
31 Name = " PlatformVerificationTask " Condition = " '$(SkipPlatformVerification)' == 'true' " >
32
33 < PlatformVerificationTask
34
35 PlatformFamilyName = " $(PlatformFamilyName) "
36
37 PlatformID = " $(PlatformID) "
38
39 SourceAssembly = " @(IntermediateAssembly) "
40
41 ReferencePath = " @(ReferencePath) "
42
43 TreatWarningsAsErrors = " $(TreatWarningsAsErrors) "
44
45 PlatformVersion = " $(TargetFrameworkVersion) " />
46
47 </ Target >
48
49 部分,红色文字为新增加的部分
50
51
52
53
54
55 于是项目生成速度大幅提高。
56
57 < noscript > </ noscript >
58
59
2
3
4
5 决定找出VS2008生成时,做了什么花费时间的工作。从工具à选项进入“选项”对话框
6
7 选择“MSBuild项目生成输出详细信息”为“诊断”这样编译时,会输出具体执行了那些任务,花费了多少时间。
8
9
10
11 结果发现最花费时间的是
12
13 Platform Verification Task
14
15
16
17 http: // blogs.msdn.com/vsdteam/archive/2006/09/15/756400.aspx有Platform Verification Task
18
19 的具体描述
20
21
22
23 参照上文的说明,修改文件
24
25 C:\Windows\Microsoft.NET\Framework\v3. 5 \Microsoft.CompactFramework.Common.targets
26
27 中
28
29 < Target
30
31 Name = " PlatformVerificationTask " Condition = " '$(SkipPlatformVerification)' == 'true' " >
32
33 < PlatformVerificationTask
34
35 PlatformFamilyName = " $(PlatformFamilyName) "
36
37 PlatformID = " $(PlatformID) "
38
39 SourceAssembly = " @(IntermediateAssembly) "
40
41 ReferencePath = " @(ReferencePath) "
42
43 TreatWarningsAsErrors = " $(TreatWarningsAsErrors) "
44
45 PlatformVersion = " $(TargetFrameworkVersion) " />
46
47 </ Target >
48
49 部分,红色文字为新增加的部分
50
51
52
53
54
55 于是项目生成速度大幅提高。
56
57 < noscript > </ noscript >
58
59