2

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

这是错误图像: Visual Studio 2008 中的错误图像

文字图片:

Instances of this error (1)  

1.   Hide Call Stack 

at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionHandlingConfigurationView.GetExceptionPolicyData(String policyName)
at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.PreBuildUp(IBuilderContext context)
at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)  

Help with this error  

MSDN Help   


Forum posts about this error  

Search the MSDN Forums for posts related to this error   

这是源代码: 源代码图像

我的编码有什么问题?我使用 Visual Studio 2008 SP1

4

1 回答 1

0

您正在显示一个或多个需要数据才能正常运行的控件,并且您尚未为设计器设置该数据。

你有两个选择:

  1. 如果它是您的控件,您可以添加一个检查以查看它是否处于设计模式。使用这些测试包装对不会在设计模式下设置的数据库等的任何调用:

    WinForms 的Component.DesignMode

    WPF 的GetIsInDesignMode

    WinRT 的DesignModeEnabled

    Silverlight 的IsInDesignTool

  2. 设置一些设计数据。具体如何操作将取决于控件。

于 2013-06-01T10:55:20.843 回答