title: Value does not fall within the expected range
body: <p>Error when trying to display the form designer.</p>
  
  <p><strong>See picture of the error:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/gl13f.jpg" alt="enter image description here"></p>
  
  <p><strong>Code of the screen:</strong></p>
  
  <pre><code>public partial class frmCanalVenda : frmEdit
  {
      public frmCanalVenda(CanalVenda canal, Cliente cli)
          : base(canal)
      {
          InitializeComponent();
          bdsCliente.DataSource = cli;
          eabBar.ReadOnlyView = false;
      }
  
      private void frmCanalVenda_Load(object sender, EventArgs e)
      {
          try
          {
              Cursor.Current = Cursors.WaitCursor;
  
              bdsAgrupamento.DataSource = Agrupamento.GetAll(DatabaseAFV.Connection);
              bdsCanal.DataSource = Canal.GetAll(DatabaseAFV.Connection);
              bdsSubCanal.DataSource = SubCanal.GetAll(DatabaseAFV.Connection);
              bdsEspecializacao.DataSource = Especializacao.GetAll(DatabaseAFV.Connection);
              bdsOperacao.DataSource = Operacao.GetAll(DatabaseAFV.Connection);
              bdsPorte.DataSource = Porte.GetAll(DatabaseAFV.Connection);
          }
          finally
          {
              Cursor.Current = Cursors.Default;
          }
      }
  }
  </code></pre>
  
  <p><strong>Text of image</strong></p>
  
  <blockquote>
    <p>To prevent possible data loss before
    loading the designer, the following
    errors must be resolved: </p>
    
    <p>Value does not fall within the
    expected range. </p>
    
    <p>Instances of this error (1)  </p>
    
    <ol>
    <li>Hide Call Stack    at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32
    errorCode, IntPtr errorInfo) at
    Microsoft.VisualStudio.NativeMethods.ThrowOnFailure(Int32
    hr, Int32[] expectedHRFailure) at
    Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.GetFileDocData(String
    fileName, FileAccess access, String
    createTemplate, Boolean addToHostList,
    Boolean nestedItem) at
    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
    info) at
    System.ComponentModel.Design.Serialization.ResourceCodeDomSerializer.SerializationResourceManager.GetMetadata()
    at
    System.ComponentModel.Design.Serialization.ResourceCodeDomSerializer.SerializationResourceManager.GetMetadataEnumerator()
    at
    System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertiesFromResources(IDesignerSerializationManager
    manager, Object value, Attribute[]
    filter) 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)</li>
    </ol>
  </blockquote>