我有一个构建脚本,它从命令行启动Visual Studio,如下所示:
devenv.exe <project file> /Rebuild "Release" /Project <project name> /UseEnv /Out <log file>
完成后,脚本会检查Visual Studio的退出代码。
我们已经从Visual Studio 2010更新到2015年。大多数项目编译没有问题,但有些项目退出代码为0xE0434352,我认为是System.InvalidOperationException。
Windows事件日志显示两个条目:
Faulting application name: devenv.exe, version: 14.0.24720.0, time stamp: 0x564ea97e
Faulting module name: KERNELBASE.dll, version: 6.1.7601.19045, time stamp: 0x56258f05
Exception code: 0xe0434352
Fault offset: 0x0000c42d
Faulting process id: 0xb64
Faulting application start time: 0x01d131c68bdc0db0
Faulting application path: c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
Report Id: cb600c61-9db9-11e5-abfc-005056c00008
和
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
at System.Windows.Forms.Control.MarshaledInvoke(System.Windows.Forms.Control, System.Delegate, System.Object[], Boolean)
at System.Windows.Forms.Control.BeginInvoke(System.Delegate, System.Object[])
at System.Windows.Forms.WindowsFormsSynchronizationContext.Post(System.Threading.SendOrPostCallback, System.Object)
at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.PostAction(System.Object)
at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(System.Threading.ContextCallback, System.Object, System.Threading.Tasks.Task ByRef)
at System.Threading.Tasks.AwaitTaskContinuation+<>c.<ThrowAsyncIfNecessary>b__18_0(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
这些项目是VB和C#Windows Forms项目。它不会发生在C ++项目中。
据我所知,组件总是正确构建,关闭visual studio时会发生异常。我修改了我们的脚本以忽略这个特定的错误,但这似乎不是一个很好的解决方案。
有人可以建议如何解决这个问题吗?
答案 0 :(得分:1)