Visual Studio 有时不编译

Visual Studio not Compiling Sometimes

我在 Windows Server 2008 上的 ISS 服务器上使用 ASP.NET 站点,它为我编译了一个解决方案 在以下问题中:

Dim command = "devenv ""Solution.sln"" /build Debug /project ""Project.vbproj""  /projectconfig Debug /out ""logBuildUpdateInfoprim.log"""
Dim cmdsi = New ProcessStartInfo(command)
cmdsi.Arguments = arg
cmdsi.CreateNoWindow = True
cmdsi.UserName = "user"
cmdsi.Password = "pass"
cmdsi.UseShellExecute = False
Dim cmd = Process.Start(cmdsi)
cmd.WaitForExit()

"user"和"pass"是给系统管理员的 我还将站点应用程序池的标识设置为 "user"

它工作了大约几周,然后在下一次编译时,devenv 进程只占用 0% 的处理器和 ~2Mb 的 RAM。它无限期地坐着。 解决此问题的唯一方法是在 windows 中以 "user" 身份登录,手动关闭 devenv 进程,然后打开 Visual Studio。之后,我可以从 windows 服务器注销,网站可以再次运行几周。

(我正在使用 Visual Studio 社区)

我怀疑 Visual Studio 需要打开才能激活 Visual Studio 帐户,或者可能是 windows 服务器的问题。无论如何,定期解决这个问题真的很痛苦。

因为我在 Visual Studio 中没有找到任何关于如何绕过登录的答案,所以我使用了

msbuild.exe

作为解决方法。