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

Forums / Bugs & Issues / Error 'Object references between two different object scopes are not allowed ' displayed when the code encounters the following statement: dynamicModuleManager.Lifecycle.Publish()

Error 'Object references between two different object scopes are not allowed ' displayed when the code encounters the following statement: dynamicModuleManager.Lifecycle.Publish()

2 posts, 0 answered
  1. Minu
    Minu avatar
    1 posts
    Registered:
    01 Dec 2015
    02 Jun
    Link to this post

    Hi,

    I am trying to incorporate hangfire with Sitefinity.

    I have created a background job and once it goes into the method (this method is created as backgroundjob) and encounters the line ' dynamicModuleManager.Lifecycle.Publish()', I get the below error:

    Object references between two different object scopes are not allowed. The object 'Telerik.Sitefinity.DynamicModules.Model.DynamicContentUrlData' is already managed by 'ObjectScopeImpl 0xd2 OpenAccessRuntime.EnlistableObjectScope' and was tried to be managed again by 'ObjectScopeImpl 0xd7 OpenAccessRuntime.EnlistableObjectScope'

    Any help would be appreciated.

     

    Thanks,

    Minu

  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    13 Jun
    Link to this post
    Hello Minu,

    That problem must be due to wrapping the code for working with the DynamicModuleManager into an using statement.
    using (var userManager = DynamicModuleManager.GetManager())
                {

    Remove the using the execution will resolve properly the object scopes. If this is not the case share the code that causes this problem.

    Regards,
    Stanislav Velikov
    Telerik
     
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
2 posts, 0 answered