值未落在预期范围内
尝试显示表单设计器时出错。
查看错误图片:
屏幕代码:< /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)
- 在 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:
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)
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
万岁玛丽:重新启动 Visual Studio 对我有用。
A hail mary: restarting Visual Studio worked for me.
此问题可能是由项目属性/设置文件的更改引起的。如果最近对设置进行了更改,请执行以下操作:-
这应该可以解决您的问题。
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:-
This should fix your issue.
卸载项目并重新加载项目对我有用。
Unload project and reload project worked for me.