locked
upgrade to Prism 4 RRS feed

  • Question

  • hi,

    in Bootstrapper (prism 2)  we did the following:

     

            protected void ConfigureContainer (IUnityContainer container, System.Configuration.Configuration config)
            {
                UnityConfigurationSection serviceSection = (UnityConfigurationSection)config.GetSection("Services");
                serviceSection.Containers.Default.Configure(container);
            }

     

    Now, with Prism 4, it will not work any more:

    - the class 'UnityConfigurationSection' is not declared any more by prism; there is only a 'ConfigurationSection' - class

    but without a container-property.

    I did not find any upgrade information to get our code running with the new prism framework.

    Has anyone an idea?

     

     

     

    Thursday, July 28, 2011 12:33 PM

Answers

  • You need to override ConfigureContainer:

     

      protected override void ConfigureContainer()
      {
       base.ConfigureContainer();
      }
    

     


    EDIT: sorry just re-read the post and somehow missed the real issue. The UnityConfigurationSection is defined in the Microsoft.Practices.Unity.Configuration namespace located in the Microsoft.Practices.Unity.Configuration.DLL
    • Marked as answer by LakeWPF Thursday, July 28, 2011 2:40 PM
    Thursday, July 28, 2011 2:04 PM

All replies

  • Are you using the UnityBoostrapper or creating your own?
    Thursday, July 28, 2011 1:38 PM
  • we derive from the UnityBootstrapper.

     

     

    Thursday, July 28, 2011 1:55 PM
  • You need to override ConfigureContainer:

     

      protected override void ConfigureContainer()
      {
       base.ConfigureContainer();
      }
    

     


    EDIT: sorry just re-read the post and somehow missed the real issue. The UnityConfigurationSection is defined in the Microsoft.Practices.Unity.Configuration namespace located in the Microsoft.Practices.Unity.Configuration.DLL
    • Marked as answer by LakeWPF Thursday, July 28, 2011 2:40 PM
    Thursday, July 28, 2011 2:04 PM
  • Thank you very much!

    That´s it: I did not reference the Microsoft.Practices.Unity.Configuration.DLL.

    The reason was that i just copied all DLL from the PRISM - setup BIN-Folder ( '.\PrismV4\Bin\Desktop' )  to myApp BIN-Folder and this special dll was NOT in there.

    I found it in '.\PrismV4\Lib\Desktop\Unity'.

     

    Again: thanks.

     

     

     

    Thursday, July 28, 2011 2:40 PM