During the build of my WPF project I sometimes get this error :
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
There is no syntactic error, the project should have compiled successfully. Sometimes a Clean/Rebuild works, other times a restart of the Visual Studio will do the trick. Therefore I do have a
The only thing that I could isolate this issue to is the "Enable ClickOnce security settings" in the Security tab of the properties window of the WPF (startup) project.
Yes, the manifest for the ClickOnce deployment has to be generated, but why does it fail? The COMException and its HRESULT change their values at each build attempt.
Where should I start tackling this issue?