Unity 出现配置错误。我正在尝试实现http://unitymvc3.codeplex.com/,但我现在被困住了,因为:
在我的统一配置中,我有以下设置:
<register type="IMainDbContext" mapTo="WorkflowContext">
<lifetime type="hierarchical" />
<constructor></constructor>
</register>
但是在创建统一的时候,(我的简单代码在这里:)
UnityConfigurationSection section = ConfigurationManager.GetSection("unity") as UnityConfigurationSection;
if (section != null)
{
section.Configure(container);
}
this.container = container;
一切都配置得很好,除了注册“IManDbContext”有LifetimeManagerType = {Name = "TransientLifetimeManager" FullName = "Microsoft.Practices.Unity.TransientLifetimeManager"}
,但它应该是hierarchical lifetime manager
你知道如何告诉统一(在配置中,而不是在代码中)我想要分层生命周期管理器吗?感谢您的任何提示。