Visual studio 2008 值不在预期范围内

Visual studio 2008 值不在预期范围内,visual-studio-2008,forms,c#-3.0,compact-framework,windows-mobile-6.1,Visual Studio 2008,Forms,C# 3.0,Compact Framework,Windows Mobile 6.1,尝试显示表单设计器时出错 请参见错误图片: public partial class frmCanalVenda : frmEdit { public frmCanalVenda(CanalVenda canal, Cliente cli) : base(canal) { InitializeComponent(); bdsCliente.DataSource = cli; eabBar.ReadOnlyView =

尝试显示表单设计器时出错

请参见错误图片:

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

屏幕代码:

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;
        }
    }
}
图像文本

以防止之前可能的数据丢失 加载设计器时,将执行以下操作 必须解决以下错误:

值不在 预期范围

此错误的实例(1)

  • 在System.Runtime.InteropServices.Marshal.ThroweExceptionForhrInternal(Int32)中隐藏调用堆栈 错误代码,IntPtr errorInfo)位于 Microsoft.VisualStudio.NativeMethods.ThrowOnFailure(Int32 hr,Int32[]预期hr故障)在 Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.GetFileDocData(字符串 文件名、文件访问权限、字符串 createTemplate,布尔addToHostList, 布尔nestedItem)在 Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.GetChildDocData(字符串 名称、文件访问、字符串 创建模板)在 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.GetResourceDocData(CultureInfo 信息,文件访问)在 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomainDesignerLoader.System.ComponentModel.Design.IResourceService.GetResourceReader(CultureInfo 信息)在 System.ComponentModel.Design.Serialization.ResourceCodeDomSerializer.SerializationResourceManager.GetMetadata() 在 System.ComponentModel.Design.Serialization.ResourceCodeDomainSerializer.SerializationResourceManager.GetMetadataEnumerator() 在 System.ComponentModel.Design.Serialization.CodeDomainSerializationBase.DeserializationPropertiesFromResources(IDesignerSerializationManager 管理器,对象值,属性[] 过滤器)在 System.ComponentModel.Design.Serialization.TypeCodeDomainSerializer.Deserialize(IDesignerSerializationManager 代码类型声明经理 声明)在 System.ComponentModel.Design.Serialization.CodeDomainDesignerLoader.PerformLoad(IDesignerSerializationManager 经理)在 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomainDesignerLoader.PerformLoad(IDesignerSerializationManager 序列化管理器)位于 System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost (主持人)

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

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

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

    万岁玛丽:重新启动Visual Studio对我有效。

    为什么不发布错误文本?显示的图片不清晰。@Oded:如果缩放页面,它将变得可读:p@KornelijePetak-如果你想,你仍然不能复制/粘贴它。我们的人,这是六个月前的事,甚至不记得我是如何解决的。哈哈,这几乎与“重新启动”或“重新安装windows”一致。但它确实奏效了,请投赞成票:)