Cant get the Quickstarts working, Oct09 Release / Method not found Exception Microsoft.Practices.ObjectBuilder2.IPolicyList

Topics: Prism v2 - Silverlight 2, Prism v2 - Silverlight 3, Prism v2 - WPF 3.5
Nov 13, 2009 at 8:16 AM

Hello,

i am trying to get the quickstarts working, but at the following line is always a Methodnotfound Exception "Microsoft.Practices.ObjectBuilder2.IPolicyList Microsoft.Practices.Unity.ExtensionContext.get_Policies()".

 

public static bool IsTypeRegistered(this IUnityContainer container, Type type)
        {
            return UnityBootstrapperExtension.IsTypeRegistered(container, type);
        }

 

(The Type is IServiceLocator)

 

How can i fix it?

 

Thank you very much for your help

Stacktracke (DE):

bei Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapperExtension.IsTypeRegistered(IUnityContainer container, Type type)
   bei Microsoft.Practices.Composite.UnityExtensions.UnityContainerHelper.IsTypeRegistered(IUnityContainer container, Type type) in C:\Important\CompositAppGuidanceOkt09\CAL\Desktop\Composite.UnityExtensions\UnityContainerHelper.cs:Zeile 39.
   bei Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.RegisterTypeIfMissing(Type fromType, Type toType, Boolean registerAsSingleton) in C:\Important\CompositAppGuidanceOkt09\CAL\Desktop\Composite.UnityExtensions\UnityBootstrapper.cs:Zeile 275.
   bei Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.ConfigureContainer() in C:\Important\CompositAppGuidanceOkt09\CAL\Desktop\Composite.UnityExtensions\UnityBootstrapper.cs:Zeile 153.
   bei StockTraderRI.StockTraderRIBootstrapper.ConfigureContainer() in C:\Important\CompositAppGuidanceOkt09\RI\Desktop\StockTraderRI\StockTraderRIBootstrapper.cs:Zeile 44.
   bei Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.Run(Boolean runWithDefaultConfiguration) in C:\Important\CompositAppGuidanceOkt09\CAL\Desktop\Composite.UnityExtensions\UnityBootstrapper.cs:Zeile 95.
   bei Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.Run() in C:\Important\CompositAppGuidanceOkt09\CAL\Desktop\Composite.UnityExtensions\UnityBootstrapper.cs:Zeile 69.
   bei StockTraderRI.App.RunInDebugMode() in C:\Important\CompositAppGuidanceOkt09\RI\Desktop\StockTraderRI\App.xaml.cs:Zeile 44.
   bei StockTraderRI.App.OnStartup(StartupEventArgs e) in C:\Important\CompositAppGuidanceOkt09\RI\Desktop\StockTraderRI\App.xaml.cs:Zeile 34.
   bei System.Windows.Application.<.ctor>b__0(Object unused)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   bei System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   bei System.Windows.Threading.DispatcherOperation.InvokeImpl()
   bei System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   bei System.Threading.ExecutionContext.runTryCode(Object userData)
   bei System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   bei System.Windows.Threading.DispatcherOperation.Invoke()
   bei System.Windows.Threading.Dispatcher.ProcessQueue()
   bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   bei System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   bei System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
   bei System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
   bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   bei System.Windows.Threading.Dispatcher.Run()
   bei System.Windows.Application.RunDispatcher(Object ignore)
   bei System.Windows.Application.RunInternal(Window window)
   bei System.Windows.Application.Run(Window window)
   bei System.Windows.Application.Run()
   bei StockTraderRI.App.Main() in C:\Important\CompositAppGuidanceOkt09\RI\Desktop\StockTraderRI\obj\Debug\App.g.cs:Zeile 0.
   bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   bei System.Threading.ThreadHelper.ThreadStart()

Nov 13, 2009 at 6:58 PM

Hi,

From the stack trace you provided I assume you are trying to run the Desktop (WPF) Stock Trader Reference Implementation. I have tried to reproduce you issue with no success.
Have you made any chagnes to the Prism folder structure or the source code? If you have, you could try decompressing Prism again and running the RI without making any changes to it.

If you haven’t, it could be useful if you could provide a repro sample so we can try to reproduce your issue. Also information about your development environment might be useful.

You said “The Type is IServiceLocator”, could you please provide more information about what you were trying to explain with that?

Please let me know if this helps.

Damian Schenkelman
http://blogs.southworks.net/dschenkelman

Dec 6, 2009 at 12:37 PM

Hi

I encountered the same problem today looking at an older sample. It looks like the reference to Unity got switched to use the Unity for Silverlight dll (the source of which II recently installed). Removing the references and re-adding the correct one (from the \LIB\Desktop\Unity folder) fixed the issue.

HTH,
Andreas