21

尝试显示表单设计器时出错。值不在预期范围内

看到错误的图片:

enter image description here

屏幕代码:

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; 
     } 
    } 
} 

图像的文本

To prevent possible data loss before loading the designer, the following errors must be resolved:

Value does not fall within the expected range.

Instances of this error (1)

  1. 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)
+0

为什么不张贴错误的_text_?这张照片看起来不清晰。 – Oded 2011-04-20 19:07:15

+0

再看一遍..我改变了。 – ridermansb 2011-04-20 19:36:34

+0

@Oded:如果你放大页面,它变得可读:p – 2011-07-22 06:06:22

回答

2

此问题可能是由项目属性/设置文件的更改引起的。如果最近对设置进行了更改,请执行以下操作: -

  1. 检查设置xml文件是否包含不包含任何不需要的元素。
  2. 关闭Visual Studio和重新启动VS并打开项目

这应该可以解决您的问题。

+0

我们的家伙,这是六个月前,甚至不记得我是如何解决它。 – ridermansb 2011-10-26 10:24:32

39

冰雹玛丽:重新启动Visual Studio为我工作。

+2

有时我想知道...... :) – dotNET 2014-11-21 14:13:32

+3

哈哈这跟“重启”或“重新安装windows”几乎一致。然而,它的工作,有一个upvote :) – Nilzor 2015-02-12 17:38:23

+2

你应该得到一个Upvote! – yossico 2015-03-23 10:45:28

相关问题