【发布时间】:2012-05-13 09:13:26
【问题描述】:
我和我的团队经常遇到此错误,但很随机,我们不确定它为什么会这样。为了解决这个问题,我们要么构建解决方案几次,要么必须重新启动 Visual Studio (10)。这是我尝试构建时遇到的错误:
错误 5 “GenerateApplicationManifest”任务意外失败。 System.Runtime.InteropServices.COMException (0x8731F230):来自 HRESULT 的异常:0x8731F230 在 System.Runtime.InteropServices.UCOMITypeInfo.ReleaseTypeAttr(IntPtr pTypeAttr) 在 Microsoft.Build.Tasks.Deployment.ManifestUtilities.ComImporter..ctor(字符串路径,OutputMessageCollection outputMessages,字符串 outputDisplayName) 在 Microsoft.Build.Tasks.Deployment.ManifestUtilities.FileReference.ImportComComponent(字符串路径,OutputMessageCollection outputMessages,字符串 outputDisplayName) 在 Microsoft.Build.Tasks.GenerateApplicationManifest.AddIsolatedComReferences(ApplicationManifest 清单) 在 Microsoft.Build.Tasks.GenerateApplicationManifest.BuildApplicationManifest(ApplicationManifest 清单) 在 Microsoft.Build.Tasks.GenerateApplicationManifest.OnManifestLoaded(清单清单) 在 Microsoft.Build.Tasks.GenerateManifestBase.BuildManifest() 在 Microsoft.Build.Tasks.GenerateManifestBase.Execute() 在 Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() 在 Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost、TaskLoggingContext taskLoggingContext、TaskHost taskHost、ItemBucket 存储桶、TaskExecutionMode howToExecuteTask、Boolean& taskResult)感谢您的帮助!
【问题讨论】:
-
您的解决方案是否混合了 C++ 和 .NET 项目,您的 .NET 项目是否使用任何正在构建的 COM 组件?这里有一些事情要尝试: - 您可以尝试将并行项目构建的最大数量设置为 1。 - 尝试使用命令行(即 MSBUILD)构建您的解决方案,看看您是否得到相同的行为 - 关闭所有设计器选项卡并构建前的工具箱
-
您的项目之一是否针对 ComInterop 公开?如果是这样,则可能是当您在本地运行解决方案(即在 VS 中调试)时,某个进程一直在保留类型库引用。确保使用该 COM 对象的所有进程(可能是您可能使用过 CREATEOBJECT 的外部应用程序)都没有运行可能是值得的。
-
试试这个链接好像这个人和你有同样的问题:Visual Studio
-
@chandhooguy,我们在这里得到的是一个相关的 COMException,而不是 PathTooLongException
标签: .net visual-studio-2010 build-error