值未落在预期范围内

发布于 2024-11-02 07:00:48 字数 2980 浏览 0 评论 0原文

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

查看错误图片:

在此处输入图像描述

屏幕代码:< /strong>

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)

  1. 在 System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32) 处隐藏调用堆栈 错误代码、IntPtr 错误信息)位于 Microsoft.VisualStudio.NativeMethods.ThrowOnFailure(Int32 小时,Int32[]预期HR失败)在 Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.GetFileDocData(字符串 文件名、文件访问权限、字符串 createTemplate,布尔值 addToHostList, 布尔嵌套项) at Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.GetChildDocData(字符串 名称、FileAccess 访问权限、字符串 创建模板)位于 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.GetResourceDocData(CultureInfo 信息,FileAccess 访问)位于 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.System.ComponentModel.Design.IResourceService.GetResourceReader(CultureInfo 信息)在 System.ComponentModel.Design.Serialization.ResourceCodeDomSerializer.SerializationResourceManager.GetMetadata() 在 System.ComponentModel.Design.Serialization.ResourceCodeDomSerializer.SerializationResourceManager.GetMetadataEnumerator() 在 System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertiesFromResources(IDesignerSerializationManager 经理,对象值,属性[] 过滤器)在 System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager 经理,代码类型声明 声明)于 System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager 经理)在 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager 序列化管理器)位于 System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost 主持人)

Error when trying to display the form designer.

See picture of the error:

enter image description here

Code of the screen:

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

Text of image

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

能怎样 2024-11-09 07:00:48

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

A hail mary: restarting Visual Studio worked for me.

演多会厌 2024-11-09 07:00:48

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

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

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

This problem can be caused by changes to the project properties / settings file. If recent changes have been made to the settings do the following:-

  1. Check that the settings xml file does not contain any unwanted elements.
  2. Close Visual Studio and restart VS and open the project

This should fix your issue.

メ斷腸人バ 2024-11-09 07:00:48

卸载项目并重新加载项目对我有用。

Unload project and reload project worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文