Issue With Manager Class
Hi,
I'm developing custom module. I have 2 model classes. Both of them derived from Content.
In this case I develope 2 manager classes ,they share the same data provider.
However the content which backend I access later will throw this error.
Please help me.The type String cannot be constructed. You must configure the container to supply this value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The type String cannot be constructed. You must configure the container to supply this value.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: The type String cannot be constructed. You must configure the container to supply this value.]
Telerik.Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.GuardTypeIsNonPrimitive(IBuilderContext context, SelectedConstructor selectedConstructor) +161
Telerik.Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.PreBuildUp(IBuilderContext context) +136
Telerik.Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) +190
Telerik.Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlanCreatorPolicy.CreatePlan(IBuilderContext context, NamedTypeBuildKey buildKey) +108
Telerik.Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context) +137
Telerik.Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) +190
Telerik.Microsoft.Practices.ObjectBuilder2.BuilderContext.NewBuildUp(NamedTypeBuildKey newBuildKey) +113
Telerik.Microsoft.Practices.Unity.ObjectBuilder.NamedTypeDependencyResolverPolicy.Resolve(IBuilderContext context) +48
BuildUp_ERegistrationModule.Data.ESubscriptionsManager(IBuilderContext ) +114
Telerik.Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context) +12
Telerik.Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context) +195
Telerik.Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) +190
Telerik.Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides) +163
[ResolutionFailedException: Resolution of the dependency failed, type = "ERegistrationModule.Data.ESubscriptionsManager", name = "OpenAccessDataProvider".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The type String cannot be constructed. You must configure the container to supply this value.
-----------------------------------------------
At the time of the exception, the container was:
Resolving ERegistrationModule.Data.ESubscriptionsManager,OpenAccessDataProvider
Resolving parameter "providerName" of constructor ERegistrationModule.Data.ESubscriptionsManager(System.String providerName, System.String transactionName)
Resolving System.String,(none)
]
Telerik.Sitefinity.Data.ManagerBase.GetManager(Type managerType, String providerName) +130
Telerik.Sitefinity.Data.ManagerBase.GetMappedManager(Type itemType, String providerName) +39
Telerik.Sitefinity.Web.UI.ContentUI.ContentView.ResolveContentManager() +234
Telerik.Sitefinity.Web.UI.ContentUI.ContentView.ResolveDetailItem() +76
Telerik.Sitefinity.Web.UI.ContentUI.ContentView.CreateChildControls() +35
System.Web.UI.Control.EnsureChildControls() +102
System.Web.UI.Control.PreRenderRecursiveInternal() +42
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
Regards,
Anton
Hello Anton,
This looks like you haven't registered your data provider in the configuration. This happens in the module configuration InitializeDefaultProviders as with the Products Module (ProductsConfig.cs). The whole module configuration is registered at the Initialize method of the module -> Config.RegisterSection<ProductsConfig>();
All the best,
Nikolay Datchev
the Telerik team