WPF application upgrade from PRISM 2 to PRISM 4.
in our derived开发者_如何转开发 Bootstrapper class (from UnityBootrapper) we did the following in Prism2:
protected override void ConfigureContainer ()
{
//......more code here
foreach (Configuration config in this.configurations)
{
if (config == null)
continue;
UnityConfigurationSection serviceSection = (UnityConfigurationSection)config.GetSection("Services");
serviceSection.Containers.Default.Configure(container);
}
//.....more code here
}
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?
The older PRISM syntax in App.config
mentions UnityConfigurationSection
explicitly
<configuration>
<configSections>
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration" />
</configSections>
<unity>
...
...
</unity>
...
...
</configuration>
now with both Unity and MEF it should be
<configuration>
<configSections>
<section name="modules" type="Microsoft.Practices.Prism.Modularity.ModulesConfigurationSection, Microsoft.Practices.Prism"/>
</configSections>
<modules>
...
...
</modules>
...
...
</configuration>
精彩评论