Unhandled Exception in WPF designer over IRegionAdapter.Initialize

Topics: Prism v2 - WPF 3.5
Jul 16, 2009 at 9:36 PM

I'm getting the following exception trying to load any WPF view in my entire solution. I'm not even using the region based stuff and had the designers working fine earlier in the day.


Method not found: 'Microsoft.Practices.Composite.Regions.IRegion Microsoft.Practices.Composite.Regions.IRegionAdapter.Initialize(System.Object, System.String)'.
   at System.RuntimeTypeHandle.GetDeclaringType()
   at System.RuntimeType.RuntimeTypeCache.GetEnclosingType()
   at System.RuntimeType.get_DeclaringType()
   at MS.Internal.Xaml.AssemblyNode.BuildNamespaces()
   at MS.Internal.Xaml.AssemblyNode.FindNamespace(Identifier name)
   at MS.Internal.Xaml.ReflectionProjectNode.BuildNamespaces()
   at MS.Internal.Xaml.ReflectionProjectNode.Find(Identifier namespaceUri)
   at MS.Internal.Xaml.PrefixScope.FindType(XamlName name)
   at MS.Internal.Xaml.XmlElement.FindElementType(PrefixScope parentScope, IParseContext context)
   at MS.Internal.DocumentTrees.Markup.XamlSourceDocument.get_RootType()
   at Microsoft.Windows.Design.Documents.Trees.MarkupDocumentTreeManager.get_RootType()
   at Microsoft.Windows.Design.Documents.MarkupDocumentManager.CalculateLoadErrorState()
   at Microsoft.Windows.Design.Documents.MarkupDocumentManager.get_LoadState()
   at MS.Internal.Host.PersistenceSubsystem.Load()
   at MS.Internal.Host.Designer.Load()
   at MS.Internal.Designer.VSDesigner.Load()
   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load()
   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view)
   at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
   at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
   at MS.Internal.Host.Isolation.IsolatedDesigner.Load()
   at MS.Internal.Designer.DesignerPane.LoadDesignerView()

Jul 17, 2009 at 6:07 PM

Hi DesertFox,

The IRegionAdapter interface is in the Microsoft.Practices.Composite assembly, an only exposes a method which is Initialize. One of the things you could check is that you have that assembly in place.
If I understand correctly you are not using regions to compose the UI:

  1. Could you provide more information about how you are loading the views? Code snippets showing where the code fails would be useful and also view code.
  2. Are you registering regions related stuff in the Bootstrapper
  3. Any other information that you might believe relevant.

Please let me know if this helps. 

Damian Schenkelman

Jul 17, 2009 at 6:28 PM

Thanks for the reply, I just figured this out a bit ago. Somehow the Microsoft.Practices.Composite and Presentation dll's were out of sync. I downloaded the latest CAB library and built everything and updated all my references to the new versions and that fixed it.