VS 2008 专业版,智能设备 .NET C# 项目 - 构建缓慢 [英] VS 2008 Professional, Smart Device .NET C# project - slow build

查看:28
本文介绍了VS 2008 专业版,智能设备 .NET C# 项目 - 构建缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 VS 2008 Professional 和智能设备 .NET C# 项目.我总共有大约 100 个 cs 文件.构建需要很长时间,我必须等待链接器大约.每次编译项目时需要 1 分钟(60 秒).我有 Core i3、4GB RAM、7200rpm 磁盘.

I have VS 2008 Professional and a Smart Device .NET C# project. I have ~100 cs files in total. The build takes a very long time, I have to wait for linker approx. 1min (60s) every time I compile the project. I have Core i3, 4GB RAM, 7200rpm disk.

这是什么原因造成的,我该如何优化构建?任何 Visual Studio 选项?

What causes this and how can I optimize the build? Any Visual Studio options?

推荐答案

如果您遵循 Hans Passant 的评论中的建议并将 MSBuild 设置为诊断输出,它将更清楚地了解哪些事情需要花费时间.如果您发现您的构建挂在许可编译器 (LC.exe) 上,那么这可能是因为它试图调用服务器并超时.您可以通过更改 machine.config 来解决此问题 -

If you follow the advise from Hans Passant's comment and set MSBuild to diagnostic output it will give a clearer picture of just what is taking the time. If you find that your build is hanging on the Licensing Compiler (LC.exe) then this could be due to it trying to call a server and timing out. You can resolve this by altering your machine.config -

编辑 c:windowsmicrosoft.netframeworkv2.0.50727configmachine.config,并添加以下项:

edit c:windowsmicrosoft.netframeworkv2.0.50727configmachine.config, and add the following key:

  <configuration>
    <runtime>
      <generatePublisherEvidence enabled="false"/>

//

根据下面的评论,我做了一些挖掘.平台验证任务有一个已知问题,它在 VS2008 中运行非常缓慢.可以在此处找到有关它的更多详细信息:

Based on the comment below I did a little digging. The platform verification task has a known issue where it runs very slowly in VS2008. More detail on it can be found here:

http://blogs.msdn.com/b/vsdteam/archive/2006/09/15/756400.aspx

解决此问题的一种方法是在您的构建中禁用任务本身.要做到这一点

One way around this is to disable the task itself in your build. To do this

1) 打开文件:

%windir%Microsoft.NETFrameworkv2.0.50727Microsoft.CompactFramework.Common.Targets

用于编辑.

2) 转到如下行:

Name="PlatformVerificationTask">

并将其更改为:

Name="PlatformVerificationTask" Condition="'$(SkipPlatformVerification)' != 'true'">

3) 将 SkipPlatformVerification 环境变量添加到系统并将其设置为true"(要重新启用平台验证,请将环境变量设置为false").如果您需要有关设置环境变量的帮助,请阅读 http://vlaurie.com/computers2/Articles/environment.htm.如果您不想添加环境变量,您可以将条件交换为始终为假的内容(即 Condition="'true' == 'false'")

3) Add the SkipPlatformVerification environment variable to the system and set it to "true" (To re-enable Platform Verification set the environment variable to "false"). If you need help on setting up an environment variable read http://vlaurie.com/computers2/Articles/environment.htm. If you don't want to add an environment variable you can swap the condition for something that is always false (i.e. Condition="'true' == 'false'")

这篇关于VS 2008 专业版,智能设备 .NET C# 项目 - 构建缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆