在构建我的WPF项目期间,我有时会收到此错误:
The "GenerateApplicationManifest" task failed unexpectedly.
System.Runtime.InteropServices.COMException (0x941270C0): Exception from HRESULT: 0x941270C0
at System.Runtime.InteropServices.UCOMITypeInfo.ReleaseTypeAttr(IntPtr pTypeAttr)
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.ComImporter..ctor(String path, OutputMessageCollection outputMessages, String outputDisplayName)
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.FileReference.ImportComComponent(String path, OutputMessageCollection outputMessages, String outputDisplayName)
at Microsoft.Build.Tasks.GenerateApplicationManifest.AddIsolatedComReferences(ApplicationManifest manifest)
at Microsoft.Build.Tasks.GenerateApplicationManifest.BuildApplicationManifest(ApplicationManifest manifest)
at Microsoft.Build.Tasks.GenerateApplicationManifest.OnManifestLoaded(Manifest manifest)
at Microsoft.Build.Tasks.GenerateManifestBase.BuildManifest()
at Microsoft.Build.Tasks.GenerateManifestBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets
没有语法错误,项目应该已成功编译。 有时清理/重建可以工作,有时重启Visual Studio就可以了。因此我确实有
我唯一可以将此问题隔离的是WPF(启动)项目的属性窗口的“安全”选项卡中的“启用ClickOnce安全设置”。
是的,必须生成ClickOnce部署的清单,但为什么会失败? COMException及其HRESULT在每次构建尝试时都会更改它们的值。
我应该从哪里开始解决这个问题?