2012-03-05 69 views
0

我有一個C++調用C#的形式。它似乎正常工作。 但是,當我打開C#項目窗體設計器時,彈出以下錯誤消息。 什麼可能是錯的。解決方案建立並運行良好。錯誤HRESULT E_FAIL已從調用返回至COM組件

錯誤HRESULT E_FAIL已經從COM組件的調用返回。

Instances of this error (1) 
  1. 隱藏調用堆棧

在System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(的Int32的errorCode,IntPtr的errorInfo中) 在System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(的Int32的errorCode) 在Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.GetFileDocData(字符串文件名,訪問的FileAccess,字符串createTemplate,布爾addToHostList,布爾nestedItem) 在Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.GetChildDocData(String name,FileAccess access,String createTemplate) at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.GetResourceDocData(CultureInfo info,FileAccess access) at Microsoft.VisualStudio .Design.Serialization.CodeDom.VSCodeDomDesignerLoader.System.ComponentModel.Design.IResourceService.GetResourceReader(CultureInfo的信息) 在System.ComponentModel.Design.Serialization.ResourceCodeDomSerializer.SerializationResourceManager.GetMetadata() 在System.ComponentModel.Design.Serialization.ResourceCodeDomSerializer .SerializationResourceManager.GetMetadataEnumerator() 在System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertiesFromResources(IDesignerSerializationManager經理,對象的值,的Attr ibute []過濾器) 在System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager經理,CodeTypeDeclaration聲明) 在System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager經理) 在Microsoft.VisualStudio.Design。 Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager) 在Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(的Int32 fReload)

+0

可能重複[錯誤HRESULT E \ _FAIL已從調用時調用COM組件VS2012返回](http://stackoverflow.com/questions/13361199/error-hresult-e-fail-has -been - 返回 - 從-A-號召-A-COM組件,vs2012,磨片) – 2016-06-09 08:37:22

回答

1

要解決這在VS2013最終我不得不遵循帖子http://rathodkrunal.blogspot.com/2011/11/visual-studio-2010-error-hresult-efail.html

其中它談論只是清理Visual Studio的ItemTemplateCache和運行VS與/調整標記一次。

萬一鏈路斷開或不可用這裏的地方曾經是老年人VS緩存:

您可以刪除在「程序Files \ Microsoft的Visual 工作室10.0 \ Common7 \ IDE的項目緩存\ ProjectTemplatesCache」,然後運行‘devenv的 /設置’重新構建緩存,看看是否有幫助。

相關問題