视觉工作室没有响应构建

时间:2023-01-14 22:53:05

I have a strange problem with VS2008. My solution has 8 projects (all c#) and hangs VS when I build. The task manager says "not responding" and the process takes 100% of one of my cores, and the memory usage gradually climbs. Eventualy the IDE responds again, builds and deploys. The hang time seems to grow longer and longer each time I build, but then when I reboot there is no hang and it goes right to the build. Anyone know why?

我对VS2008有一个奇怪的问题。我的解决方案有8个项目(所有c#)并在我构建时挂起VS.任务管理器说“没有响应”,并且该过程占据了我的一个核心的100%,并且内存使用量逐渐增加。最后,IDE会再次响应,构建和部署。每次构建时,挂起时间似乎越来越长,但是当我重新启动时,没有挂起并且它正好构建。谁知道为什么?

4 个解决方案

#1


No idea, but what happens when you run MSBuild on the command line with your solution? Does it hang? If so, run it again with full verbosity and see where it hangs.

不知道,但是当您使用解决方案在命令行上运行MSBuild时会发生什么?它挂了吗?如果是这样,请以完整的详细程度再次运行它,并查看它挂起的位置。

#2


You can run Visual Studio in a way as to log what is happening. Open your IDE directory, find devenv.exe.config, and add this line:

您可以以记录正在发生的事情的方式运行Visual Studio。打开IDE目录,找到devenv.exe.config,然后添加以下行:

  <system.diagnostics>
        <trace autoflush="true" indentsize="4">
            <listeners>
               <add name="myListener" 
type="System.Diagnostics.TextWriterTraceListener, System version=1.0.3300.0, 
Culture=neutral, PublicKeyToken=b77a5c561934e089" 
initializeData="c:\myListener.log" />
               <remove name="Default" />
            </listeners>
        </trace>
    </system.diagnostics>

This should create a log file on you c drive (once you restart visual studio). Be sure to backup your existing devenv.exe.config first.

这应该在你的c盘上创建一个日志文件(一旦你重新启动visual studio)。请务必先备份现有的devenv.exe.config。

View the log and hopefully you will see which actions are causing it to take so long.

查看日志,希望您将看到导致它花费这么长时间的操作。

#3


I had the same problem. It seems that my antivirus (avast) was detecting the compiled program as malware and blocking it. When I tried to build with avast's "File System Shield" turned off, I had no problem.

我有同样的问题。似乎我的防病毒软件(avast)将已编译的程序检测为恶意软件并将其阻止。当我尝试使用av​​ast的“文件系统盾”关闭时,我没有问题。

Try to turn "File System Shield" off, or even better disable the specific folder through "File System Shield" options.

尝试关闭“File System Shield”,甚至通过“File System Shield”选项更好地禁用特定文件夹。

#4


By default Visual Studio build only uses 1 core!

默认情况下,Visual Studio构建仅使用1个核心!

To get the build process to use all cores use MSBuild!

要使构建过程使用所有内核,请使用MSBuild!

Have a read of this excellent blog entry on Speeding Up Visual Studio Builds

阅读关于加速Visual Studio Builds的这篇优秀博客文章

#1


No idea, but what happens when you run MSBuild on the command line with your solution? Does it hang? If so, run it again with full verbosity and see where it hangs.

不知道,但是当您使用解决方案在命令行上运行MSBuild时会发生什么?它挂了吗?如果是这样,请以完整的详细程度再次运行它,并查看它挂起的位置。

#2


You can run Visual Studio in a way as to log what is happening. Open your IDE directory, find devenv.exe.config, and add this line:

您可以以记录正在发生的事情的方式运行Visual Studio。打开IDE目录,找到devenv.exe.config,然后添加以下行:

  <system.diagnostics>
        <trace autoflush="true" indentsize="4">
            <listeners>
               <add name="myListener" 
type="System.Diagnostics.TextWriterTraceListener, System version=1.0.3300.0, 
Culture=neutral, PublicKeyToken=b77a5c561934e089" 
initializeData="c:\myListener.log" />
               <remove name="Default" />
            </listeners>
        </trace>
    </system.diagnostics>

This should create a log file on you c drive (once you restart visual studio). Be sure to backup your existing devenv.exe.config first.

这应该在你的c盘上创建一个日志文件(一旦你重新启动visual studio)。请务必先备份现有的devenv.exe.config。

View the log and hopefully you will see which actions are causing it to take so long.

查看日志,希望您将看到导致它花费这么长时间的操作。

#3


I had the same problem. It seems that my antivirus (avast) was detecting the compiled program as malware and blocking it. When I tried to build with avast's "File System Shield" turned off, I had no problem.

我有同样的问题。似乎我的防病毒软件(avast)将已编译的程序检测为恶意软件并将其阻止。当我尝试使用av​​ast的“文件系统盾”关闭时,我没有问题。

Try to turn "File System Shield" off, or even better disable the specific folder through "File System Shield" options.

尝试关闭“File System Shield”,甚至通过“File System Shield”选项更好地禁用特定文件夹。

#4


By default Visual Studio build only uses 1 core!

默认情况下,Visual Studio构建仅使用1个核心!

To get the build process to use all cores use MSBuild!

要使构建过程使用所有内核,请使用MSBuild!

Have a read of this excellent blog entry on Speeding Up Visual Studio Builds

阅读关于加速Visual Studio Builds的这篇优秀博客文章