Error 'Object references between two different object sc

Posted by Community Admin on 04-Aug-2018 21:21

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

All Replies

Posted by Community Admin on 02-Jun-2016 00:00

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

Posted by Community Admin on 13-Jun-2016 00:00

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
 

This thread is closed