1
Vote

VS 2010 crashes when adding a page w/ presenter via WCSF 2010

description

When adding a page w/ presenter I receive the following error, which then crashes VS2010 and must re-start:
 
Recipe Framework Error. The wizard failed to execute. The error was: Unable to cast object of type 'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings' to type 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.IType.'
 
I have several projects that use WCSF that have essentially the same architecture. The error occurs on some projects but not others.
 
As a work-around I've been creating pages in a working solution and then moving them to the broken solution.

comments

Wavejumper313 wrote Dec 7, 2011 at 6:28 PM

The problem seems to "jump" from one solution to the next. For example, I have 3 solutions: A, B, and C. The problem occurred in A but not B or C. Then, I noticed the problem in B but, simultaneously, the problem went away in A and C was still not affected. Now, the problem is in project C but not A or B. (I'm not making this up, by the way.) I can't figure it out. The problem seems to jump randomly from one solution to the next. I've made no significant changes to any of the projects, just a new page here and a new page there . . . lather, rinse and repeat. I've searched the projects for the objects in question and they are located only in Microsoft.Practices.EnterpriseLibrary.Data and Microsoft.Practices.EnterpriseLibrary.Common dlls. I'm not sure what to do about this or how to problem solve any further. (Stuff like this makes me want to quit my job and go work at McDonald's!)

Wavejumper313 wrote Dec 12, 2011 at 2:27 PM

Stack Trace:

Microsoft.Practices.WizardFramework.WizardExecutionException: The wizard failed to execute. The error was:
Unable to cast object of type 'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings' to type 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ITypeRegistrationsProvider'. ---> System.InvalidCastException: Unable to cast object of type 'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings' to type 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ITypeRegistrationsProvider'.
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.TypeLoadingLocator.GetRegistrationsInternal(IConfigurationSource configurationSource, Func3 registrationAccessor)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.TypeLoadingLocator.GetRegistrations(IConfigurationSource configurationSource)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.CompositeTypeRegistrationsProviderLocator.<GetRegistrations>b__0(ITypeRegistrationsProvider l, IConfigurationSource cs)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.CompositeTypeRegistrationsProviderLocator.<>c__DisplayClass5.<GetRegistrationsInternal>b__4(ITypeRegistrationsProvider l)
at System.Linq.Enumerable.<SelectManyIterator>d__14
2.MoveNext()
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.Unity.UnityContainerConfigurator.RegisterAllCore(IConfigurationSource configurationSource, ITypeRegistrationsProvider rootProvider)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ChangeTrackingContainerConfigurator.RegisterAll(IConfigurationSource configurationSource, ITypeRegistrationsProvider rootProvider)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.ConfigureContainer(ITypeRegistrationsProvider locator, IContainerConfigurator configurator, IConfigurationSource configSource)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.ConfigureContainer(IContainerConfigurator configurator, IConfigurationSource configSource)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Unity.EnterpriseLibraryCoreExtension.Initialize()
at Microsoft.Practices.Unity.UnityContainerExtension.InitializeExtension(ExtensionContext context)
at Microsoft.Practices.Unity.UnityContainer.AddExtension(UnityContainerExtension extension)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Unity.EnterpriseLibraryBlockExtension.Initialize()
at Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.Unity.ValidationBlockExtension.Initialize()
at Microsoft.Practices.Unity.UnityContainerExtension.InitializeExtension(ExtensionContext context)
at Microsoft.Practices.Unity.UnityContainer.AddExtension(UnityContainerExtension extension)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.Unity.UnityContainerConfigurator.AddValidationExtension()
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.Unity.UnityContainerConfigurator..ctor(IUnityContainer container)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.CreateDefaultContainer(IConfigurationSource configurationSource)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.SetCurrentContainerIfNotSet()
at Microsoft.Practices.EnterpriseLibrary.Validation.ValidationFactory.get_DefaultCompositeValidatorFactory()
at Microsoft.Practices.EnterpriseLibrary.Validation.PropertyValidationFactory.GetPropertyValidatorFromAttributes(Type type, PropertyInfo propertyInfo, String ruleset, MemberAccessValidatorBuilderFactory memberAccessValidatorBuilderFactory)
at Microsoft.Practices.EnterpriseLibrary.Validation.PropertyValidationFactory.GetPropertyValidator(Type type, PropertyInfo propertyInfo, String ruleset, ValidationSpecificationSource validationSpecificationSource, MemberAccessValidatorBuilderFactory memberAccessValidatorBuilderFactory)
at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.ValidationIntegrationHelper.GetValidator()
at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.ValidatedControlItem.get_Validator()
at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.ValidationProvider.PerformValidation(ValidatedControlItem validatedControlItem)
at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.ValidatedControlItem.OnValidating(Object source, CancelEventArgs e)
at System.Windows.Forms.Control.OnValidating(CancelEventArgs e)
at System.Windows.Forms.Control.NotifyValidating()
at System.Windows.Forms.Control.PerformControlValidation(Boolean bulkValidation)
at System.Windows.Forms.Control.PerformContainerValidation(ValidationConstraints validationConstraints)
at System.Windows.Forms.ContainerControl.ValidateChildren(ValidationConstraints validationConstraints)
at System.Windows.Forms.UserControl.ValidateChildren(ValidationConstraints validationConstraints)
at System.Windows.Forms.UserControl.ValidateChildren()
at Microsoft.Practices.WebClientFactory.CustomWizardPages.CreateViewPageBase._viewNameTextBox_TextChanged(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnTextChanged(EventArgs e)
at System.Windows.Forms.TextBoxBase.OnTextChanged(EventArgs e)
at System.Windows.Forms.Control.set_Text(String value)
at System.Windows.Forms.TextBoxBase.set_Text(String value)
at System.Windows.Forms.TextBox.set_Text(String value)
at Microsoft.Practices.WebClientFactory.CustomWizardPages.CreateViewPageBase.ShowViewName(String viewName, String viewFileExtension)
at Microsoft.Practices.WebClientFactory.CustomWizardPages.CreateViewPageBasePresenter.OnViewReady()
at Microsoft.Practices.WebClientFactory.CustomWizardPages.CreateViewPageBase.InitializePresenterAndModel()
at Microsoft.Practices.WebClientFactory.CustomWizardPages.CreateViewPageBase.OnLoad(EventArgs e)
at System.Windows.Forms.UserControl.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at Microsoft.WizardFramework.WizardForm.Start(IWin32Window parent)
at Microsoft.Practices.WizardFramework.WizardGatheringService.Microsoft.Practices.Common.Services.IValueGatheringService.Execute(XmlElement data, Boolean allowSuspend)
--- End of inner exception stack trace ---
at Microsoft.Practices.WizardFramework.WizardGatheringService.Microsoft.Practices.Common.Services.IValueGatheringService.Execute(XmlElement data, Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(IAssetReference reference)
at Microsoft.Practices.RecipeFramework.RecipeReference.OnExecute()
at Microsoft.Practices.RecipeFramework.AssetReference.Execute()
at Microsoft.Practices.RecipeFramework.VisualStudio.RecipeMenuCommand.OnExec()
at Microsoft.Practices.RecipeFramework.VisualStudio.AssetMenuCommand.Invoke()

wrote Feb 21, 2013 at 11:02 PM