none
Error HRESULT E_FAIL has been returned from a call to a COM component. VB.net (Windows 10 + VS 2015 Community) RRS feed

  • Question

  • Please assist me. I am getting the below error and stack trace when trying to open the design of a .vb form

    Running (Windows 10 + VS 2015 Community)

    Error HRESULT E_FAIL has been returned from a call to a COM component.  

    at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
    at Microsoft.VisualStudio.LanguageServices.Implementation.Utilities.Exceptions.ThrowEFail()
    at Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.CodeTypeRef.LookupTypeSymbol()
    at Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.CodeTypeRef.get_TypeKind()
    at EnvDTE.CodeTypeRef.get_TypeKind()
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.GetUrtTypeFromVsType(CodeTypeRef vsType)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.OnTypePopulateMembers(Object sender, EventArgs e)
    at System.CodeDom.CodeTypeDeclaration.get_Members()
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.MergedCodeDomParser.CodeTypeDeclarationPopulator.OnPopulateMembers(Object sender, EventArgs e)
    at System.CodeDom.CodeTypeDeclaration.get_Members()
    at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
    at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload) 

    Wednesday, September 21, 2016 1:50 PM

Answers

  • Try doing a Clean and Rebuild from the Build menu.  If the problem persists, you may need to manually edit some hidden files or the form's resx data.

    Do you have a custom control in the project?  Did you change that custom control while an instance was on the form in question?  This looks like a case of serialized data which no longer matches the object from which it was serialized (e.g you saved an instance of a custom class in a control property and then changed the definition of that custom class).


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Wednesday, September 21, 2016 2:05 PM
    Moderator

All replies

  • Try doing a Clean and Rebuild from the Build menu.  If the problem persists, you may need to manually edit some hidden files or the form's resx data.

    Do you have a custom control in the project?  Did you change that custom control while an instance was on the form in question?  This looks like a case of serialized data which no longer matches the object from which it was serialized (e.g you saved an instance of a custom class in a control property and then changed the definition of that custom class).


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Wednesday, September 21, 2016 2:05 PM
    Moderator
  • Does your project have a Reference to itself by any chance?

    Also, shut down Visual Studio and try deleting the projects .suo file (make a copy in another folder first).


    Paul ~~~~ Microsoft MVP (Visual Basic)


    Wednesday, September 21, 2016 2:07 PM
  • I had this issue and the project did indeed have a Reference to itself. I deleted that. It's working again. I have no idea how that happened.
    Saturday, August 15, 2020 12:26 PM