title: Error "Value cannot be null. Parameter name: objectType" when opening a VB.NET Windows Forms in designer
body: <p>I have Windows Forms App in VB.NET it runs fine, I added some code event manually, without designer, like this:</p>
  
  <blockquote>
    <p>Private Sub bindingNavigatorAddNewItem_Click(sender As System.Object,
    e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click</p>
    
    <p>namesBindingSource.AddNew() </p>
    
    <p>End Sub</p>
  </blockquote>
  
  <p>And one the Form1.Designer.vb, InitializeComponent method this code</p>
  
  <blockquote>
    <p>AddHandler Me.BindingNavigatorAddNewItem.Click, AddressOf
    Me.bindingNavigatorAddNewItem_Click</p>
  </blockquote>
  
  <p>Now, even though the form runs fine, and the event is executed correctly; the form fails at design time with the error:</p>
  
  <blockquote>
    <p>Value cannot be null. Parameter name: objectType </p>
    
    <p>at
    System.ComponentModel.TypeDescriptor.TypeDescriptionNode.GetRuntimeType(Type
    objectType) at
    System.ComponentModel.TypeDescriptionProvider.GetRuntimeType(Type
    reflectionType) at
    Microsoft.VisualStudio.Design.MultiTargetingContextProvider.GetRuntimeType(Type
    objectType) at
    Microsoft.VisualStudio.Design.Serialization.CodeDom.HandlesClauseManager.GetFieldType(String
    fieldName, Type documentBaseType) at
    Microsoft.VisualStudio.Design.Serialization.CodeDom.HandlesClauseManager.GetReferencedComponentType(String
    componentName, CodeTypeDeclaration codeTypeDecl,
    ITypeResolutionService loader, IDictionary&amp; cache) at
    Microsoft.VisualStudio.Design.Serialization.CodeDom.HandlesClauseManager.ParseHandlesClauses(CodeTypeDeclaration
    codeTypeDecl, Boolean updateCache) at
    Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.OnMethodPopulateStatements(Object
    sender, EventArgs e) at
    System.CodeDom.CodeMemberMethod.get_Statements() 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
    System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost
    host)</p>
  </blockquote>
  
  <p>Now, I notice it doesn't happen if I bind the event by designer, instead of manually.</p>
  
  <p>But I still need to do it manually, because it will eventually be generated by some DTE automation code.</p>
  
  <p>Also if after the error I press the link "Ignore and Continue" it shows the form fine at design time, but why it is failing in the first place?</p>