在我们派生的Bootstrapper类(来自UnityBootrapper)中,我们在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
}
现在,使用Prism 4,它将不再起作用了:
但没有容器属性。
我没有找到任何升级信息来使用新的prism框架运行我们的代码。
有人有想法吗?
答案 0 :(得分:2)
App.config
中较旧的PRISM语法明确提及UnityConfigurationSection
<configuration>
<configSections>
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration" />
</configSections>
<unity>
...
...
</unity>
...
...
</configuration>
现在Unity和MEF应该是
<configuration>
<configSections>
<section name="modules" type="Microsoft.Practices.Prism.Modularity.ModulesConfigurationSection, Microsoft.Practices.Prism"/>
</configSections>
<modules>
...
...
</modules>
...
...
</configuration>