1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Issue With Manager Class

Issue With Manager Class

2 posts, 0 answered
  1. Anton
    Anton avatar
    6 posts
    Registered:
    09 Jun 2011
    16 Jun 2011
    Link to this post
    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.

    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

    Please help me.

    Regards,

    Anton
  2. Nikolay Datchev
    Nikolay Datchev avatar
    87 posts
    Registered:
    01 Nov 2016
    20 Jun 2011
    Link to this post
    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
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered